

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.
GOLAND CANNOT RESOLVE DIRECTORY DOWNLOAD
You can get the build via the Toolbox App, download it from our website, or use a snap package (for Ubuntu).

Visual separators between stages in multi-stage Dockerfiles in the editor ( IDEA-261079).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. Visual Stage Separator in multistage Dockerfiles.Quick access to recent projects on Windows.Create Type quick-fix generates missing fields.
