![]() ![]() Log.Printf("Reading %s: %v", filename, err)Ĭapital letters and dots would be out of place here. The error strings should be lowercase and without punctuation, since they could be printed in the middle of the message. GoLand has an inspection that warns you about wrong formatting of error strings: “Error strings should not be capitalized or end with punctuation”. You might also notice that our debugger has a new UI that is a little more modern and minimalist. This change comes with the ability to show and hide object types in the Debug tool window, which was described in the previous EAP post. It should help you concentrate on the problem without being distracted by long lines. Now you will see only the last part of the full name. GoLand no longer displays the full package name in the debugger’s Threads & Variables window (previously called Variables). Hopefully, this will help to avoid confusion. For instance, if you have an interface with T=*int, and V=nil, it will be shown like this: To detect such cases, we changed how interfaces are represented in the debugger window. ![]() Such an interface value will therefore be non- nil even when the pointer value V inside is nil. If we store a nil pointer of type *int inside an interface value, the inner type will be *int regardless of the value of the pointer: ( T=*int, V=nil). Go even has a section dedicated to this gotcha in its FAQ: If in your program you have an interface with a value containing a nil pointer, that interface will not be equal to nil, because the inner type is not nil. For an interface to be nil, both of these components must be nil. Interfaces in Go have two components, a type and a value of that type. Go, like any other programming language, has some gotchas. You can get the EAP build via the Toolbox App, download it from our website, use a snap package (for Ubuntu), or from inside GoLand, select Check IDE updates for Early Access Program in Preferences / Settings | Appearance & Behavior | System Settings | Updates.īetter representation of nil interfaces in the debugger The second build of the 2021.3 EAP is available for you to install. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |