![]() If you use Rename, Shift + F6, on the referenced file or folder from the Project Tool window, it will be renamed inside the embed directive.Īnd if you invoke Find Usages, Alt + F7 on Windows/Linux or Opt + F7 on macOS, then you’ll be able to find it inside your code too!ĭid you notice that you can also use completion inside the embed directive? It can also display some useful information about them, such as the file size, and it can even allow you to rename them inside the code. The IDE allows you to quickly navigate from references inside the embed directive to the files and folders in your project. In this case, “resources” is a reference to a folder in the project directory with the same name. That’s because we didn’t stop at just adding a different color for this type of comment. You may notice in the screenshot that “resources” is highlighted a little bit differently than usual. We also need to declare these variables at the top level of our package, which means that these variables cannot be contained within function bodies.įinally, we need to add the //go:embed directive for embedding to work. Let’s take a look at how we could do that.Įmbedding works on a few types of variables: string, byte, and embed.FS. Starting with Go 1.16, which is due to be released sometime soon, you’ll be able to embed files and directories into a Go binary at build time. Or from inside GoLand, select Automatically check updates for Early Access Program in Settings/Preferences | Appearance & Behavior | System Settings | Updates. You can get the build via the Toolbox App, download it from our website, or use a snap package (for Ubuntu). Select Font variations from IDE settingsĪnd of course, there are plenty of other fixes and improvements under the hood.Visual separators between stages in multi-stage Dockerfiles in the editor ( IDEA-261079).Quick access to recent projects on Windows.Create Type quickfix generates missing fields ( GO-7615). ![]() WSL2 (Windows Subsystem for Linux) ( GO-4377).Support for //go:embed is now available for Go 1.16 or later ( GO-10062).It has a lot of new and exciting features to try out. It’s a new week, and we have a new GoLand 2021.1 EAP release to share with you.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |