{"id":8337,"date":"2015-11-12T14:59:57","date_gmt":"2015-11-12T12:59:57","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=8337"},"modified":"2015-12-16T10:48:17","modified_gmt":"2015-12-16T08:48:17","slug":"embedding-assets-go","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/","title":{"rendered":"Embedding Assets in Go"},"content":{"rendered":"<p>In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into chef-runner, one of my open-source Go projects. My goal is to enable you to apply this useful technique to your own projects \u2014 by using the right tools for the job and combining them in the best possible way. Let\u2019s get started!<\/p>\n<h2>Meet chef-runner: The Fastest Way to Run Chef Cookbooks<\/h2>\n<p>The goal of <a href=\"https:\/\/github.com\/mlafeldt\/chef-runner\">chef-runner<\/a> is to speed up development and testing of <a href=\"https:\/\/www.chef.io\/\">Chef<\/a> cookbooks. I originally developed the tool as a fast alternative to the painfully slow <code>vagrant provision<\/code> command. chef-runner has since evolved and can now be used to rapidly provision not only local Vagrant machines but also remote hosts like EC2 instances.<\/p>\n<p>One of the things chef-runner can do is to install Chef on a machine before provisioning it. This makes it possible to set up bare servers that have nothing installed but the base operating system. For this feature, chef-runner used to download the <a href=\"https:\/\/docs.chef.io\/install_omnibus.html\">Omnibus installer<\/a> \u2014 better known as <code>install.sh<\/code> script \u2014 to a local folder before copying it to the target machine, where it will be executed to install Chef.<\/p>\n<p>Later, I decided to change the mechanism a bit. Instead of downloading the installer script from the internet, I thought it would be better to embed the script and make it part of chef-runner\u2019s source code. This would yield the following benefits:<\/p>\n<ul>\n<li><em>Simplicity.<\/em> The code ends up being simpler. No download logic. No clever caching.<\/li>\n<li><em>Transparency.<\/em> Always use the same script that is checked into version control.<\/li>\n<li><em>Speed<\/em>. No need to download the script again for each project.<\/li>\n<\/ul>\n<p>At the same time, I accepted the fact that users might not benefit from improvements to the installer immediately, simply because it gets updated so rarely.<\/p>\n<p>chef-runner is written in Go. I knew that it\u2019s possible to embed assets in Go, and this seemed like the perfect opportunity to get familiar with the tooling. Here\u2019s how I ended up doing it using a combination of <code>go-bindata<\/code> and <code>go generate<\/code>.<\/p>\n<h2>Embedding Assets Made Simple with go-bindata<\/h2>\n<p><a href=\"https:\/\/github.com\/jteeuwen\/go-bindata\">go-bindata<\/a> converts any text or binary file into Go source code, making it the perfect tool for embedding data into Go programs. You can use it, for example, to embed assets such as CSS, JavaScript, and image files into your web application. The result will be a fully stand-alone binary that can be deployed just as easily as any other Go program.<\/p>\n<p>I used <code>go-bindata<\/code> to add the Omnibus installer as an asset to chef-runner\u2019s <a href=\"https:\/\/github.com\/mlafeldt\/chef-runner\/blob\/v0.9.0\/chef\/omnibus\/omnibus.go\">omnibus package<\/a>. For this, all I had to do was download the installer script once and then invoke the <code>go-bindata<\/code> command-line tool for generating Go code from it. The exact steps are as follows:<\/p>\n<pre class=\" brush:php\"># inside $GOPATH\/src\/github.com\/mlafeldt\/chef-runner\r\n$ cd chef\/omnibus\/ \r\n$ mkdir assets \r\n$ curl https:\/\/www.chef.io\/chef\/install.sh &gt; assets\/install.sh \r\n$ go-bindata -pkg omnibus -o assets.go assets\/<\/pre>\n<p>Afterwards I had to adapt <code>chef\/omnibus\/omnibus.go<\/code> to use the asset directly instead of downloading it. Asset data can be accessed via the <code>Asset<\/code> function, which is included in the generated <a href=\"https:\/\/github.com\/mlafeldt\/chef-runner\/blob\/v0.9.0\/chef\/omnibus\/assets.go\">assets.go<\/a> source file. The resulting code ended up looking like this:<\/p>\n<pre class=\" brush:php\">\/\/ chef\/omnibus\/omnibus.go\r\n\r\npackage omnibus\r\n\r\ntype Installer struct { \r\n    ChefVersion string \r\n    SandboxPath string \r\n    RootPath string \r\n    Sudo bool \r\n}\r\n\r\nfunc (i Installer) writeOmnibusScript() error { \r\n    script := path.Join(i.SandboxPath, \"install.sh\") \r\n    log.Debugf(\"Writing Omnibus script to %s\\n\", script) \r\n    data, err := Asset(\"assets\/install.sh\") \r\n    if err != nil { \r\n        return err \r\n    } \r\n    return ioutil.WriteFile(script, []byte(data), 0644) \r\n}<\/pre>\n<p>That\u2019s really all I had to do as far as embedding is concerned; I was surprised how little effort it took.<\/p>\n<p>However, there\u2019s one thing I don\u2019t like about the <code>Asset<\/code> function generated by <code>go-bindata<\/code>: It will show up in your package\u2019s Godoc, which might be a little confusing, to say the least. One possible workaround is to store assets in a separate package.<\/p>\n<p>If you\u2019d like to learn more about <code>go-bindata<\/code> and its features, check out the project\u2019s <a href=\"https:\/\/github.com\/jteeuwen\/go-bindata#readme\">README<\/a>. Among other things, there\u2019s a special debug mode in which asset data will be loaded from the original file on disk \u2014 via the same asset API. This is useful during development when you don\u2019t want to redeploy your code every time you touch your assets.<\/p>\n<p>Another related project, <a href=\"https:\/\/github.com\/elazarl\/go-bindata-assetfs\">go-bindata-assetfs<\/a>, can be used to serve files that have been embedded with <code>go-bindata<\/code> via the <code>net\/http<\/code> package (by implementing the <code>http.FileSystem<\/code> interface). Once again, Go\u2019s focus on composability makes for good complementary solutions.<\/p>\n<h2>go generate: Integrated Code Generation<\/h2>\n<p>While tools like <code>go-bindata<\/code> are valuable on their own, you still need to integrate them into your build process. For this, you might consider using a build tool like Make to glue all the pieces together. But wouldn\u2019t it be great if Go itself would provide the ability to automatically generate source code? Well, it does!<\/p>\n<p><a href=\"https:\/\/blog.golang.org\/go1.4\">Go 1.4<\/a> introduced a new command, <code>go generate<\/code>, to automate the generation of source code before compilation. The tool works by scanning Go source code for special comments that define commands to run. This way you can declare build instructions in your code, keeping everything together in a nice way.<\/p>\n<p>This is the comment I added to chef-runner\u2019s <code>omnibus<\/code> package:<\/p>\n<pre class=\" brush:php\">\/\/ chef\/omnibus\/omnibus.go\r\n\r\npackage omnibus\r\n\r\n\/\/go:generate go-bindata -pkg $GOPACKAGE -o assets.go assets\/<\/pre>\n<p>Now, when running <code>go generate<\/code>, it will pick up the command and execute <code>go-bindata<\/code> with the specified parameters (<code>$GOPACKAGE<\/code> will be replaced with the actual package name, i.e., \u201comnibus\u201d). Let\u2019s generate some source code:<\/p>\n<pre class=\" brush:php\">$ go generate -x .\/chef\/omnibus\r\ngo-bindata -pkg omnibus -o assets.go assets\/<\/pre>\n<p>The <code>-x<\/code> flag causes <code>go generate<\/code> to print commands as they are executed. The one command shown above should look familiar.<\/p>\n<p>As with most Go tools, you can run <code>go generate .\/...<\/code> to process all packages of your project at once. If your Go project happens to contain a <code>Makefile<\/code> \u2014 as most do these days \u2014 it\u2019s a good idea to provide <code>make generate<\/code>, both as a shorthand and for use by other Make targets.<\/p>\n<p>There is one thing you need to be aware of when using <code>go generate<\/code>, though. The tool isn\u2019t integrated with <code>go get<\/code>, as one might expect. Because of that, your project will only be \u201cgo gettable\u201d if you check in all sources created by <code>go generate<\/code>. That\u2019s why I put the mentioned <a href=\"https:\/\/github.com\/mlafeldt\/chef-runner\/blob\/v0.9.0\/chef\/omnibus\/assets.go\">assets.go<\/a> file under version control.<\/p>\n<p>For more detailed information on <code>go generate<\/code>, consult <code>go help generate<\/code> or, better yet, read <a href=\"http:\/\/blog.golang.org\/generate\">this article<\/a> on the Go blog.<\/p>\n<h2>In Conclusion<\/h2>\n<p>All in all, embedding assets in Go is straight forward thanks to existing tooling. There\u2019s <code>go-bindata<\/code>, which can convert any files into embeddable assets, and there\u2019s <code>go generate<\/code>, which automates the generation of Go code in a nicely integrated way. I\u2019m sure we\u2019ll see more of these convenient tools in the not-so-distant future.<\/p>\n<p>Last but not least, in one of my other open-source projects, I used a <a href=\"https:\/\/github.com\/mlafeldt\/pkgcloud\/blob\/master\/gendistros.py\">Python script<\/a> to generate a Go map of distributions supported by <a href=\"https:\/\/packagecloud.io\/\">Packagecloud<\/a>. By doing so before compilation, I managed to save a rather expensive API call that would otherwise be made at runtime. I recommend checking out the <a href=\"https:\/\/github.com\/mlafeldt\/pkgcloud\">full source code<\/a> if you\u2019re interested in seeing another practical example of embedding assets in Go.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td><span class=\"reference\">Reference: <\/span><\/td>\n<td><a href=\"http:\/\/blog.codeship.com\/embedding-assets-in-go\/\">Embedding Assets in Go<\/a> from our <a href=\"http:\/\/www.webcodegeeks.com\/wcg\/\">WCG partner<\/a> Florian Motlik at the <a href=\"http:\/\/blog.codeship.com\/\">Codeship Blog<\/a> blog.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into chef-runner, one of my open-source Go projects. My goal is to enable you to apply this useful technique to your own projects \u2014 by using &hellip;<\/p>\n","protected":false},"author":115,"featured_media":927,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[213],"class_list":["post-8337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-development","tag-go"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Embedding Assets in Go - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Embedding Assets in Go - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2015-11-12T12:59:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2015-12-16T08:48:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Mathias Lafeldt\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@mlafeldt\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Mathias Lafeldt\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\"},\"author\":{\"name\":\"Mathias Lafeldt\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1e4d5f11775e556ed3b14ac770759eed\"},\"headline\":\"Embedding Assets in Go\",\"datePublished\":\"2015-11-12T12:59:57+00:00\",\"dateModified\":\"2015-12-16T08:48:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\"},\"wordCount\":1099,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"keywords\":[\"Go\"],\"articleSection\":[\"Web Dev\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\",\"name\":\"Embedding Assets in Go - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"datePublished\":\"2015-11-12T12:59:57+00:00\",\"dateModified\":\"2015-12-16T08:48:17+00:00\",\"description\":\"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Web Dev\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/web-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Embedding Assets in Go\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1e4d5f11775e556ed3b14ac770759eed\",\"name\":\"Mathias Lafeldt\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f7902955e0a00b4f39956366cc4b644a256944a2e6dcc6258e7e2393fad6dbe0?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f7902955e0a00b4f39956366cc4b644a256944a2e6dcc6258e7e2393fad6dbe0?s=96&d=mm&r=g\",\"caption\":\"Mathias Lafeldt\"},\"description\":\"Mathias is an infrastructure developer at Jimdo with a preference for Ruby and Go. He writes about programming at mlafeldt.github.io.\",\"sameAs\":[\"http:\/\/mlafeldt.github.io\/\",\"https:\/\/x.com\/mlafeldt\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/mathias-lafeldt\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Embedding Assets in Go - Web Code Geeks - 2026","description":"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/","og_locale":"en_US","og_type":"article","og_title":"Embedding Assets in Go - Web Code Geeks - 2026","og_description":"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into","og_url":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2015-11-12T12:59:57+00:00","article_modified_time":"2015-12-16T08:48:17+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","type":"image\/jpeg"}],"author":"Mathias Lafeldt","twitter_card":"summary_large_image","twitter_creator":"@mlafeldt","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Mathias Lafeldt","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/"},"author":{"name":"Mathias Lafeldt","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1e4d5f11775e556ed3b14ac770759eed"},"headline":"Embedding Assets in Go","datePublished":"2015-11-12T12:59:57+00:00","dateModified":"2015-12-16T08:48:17+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/"},"wordCount":1099,"commentCount":0,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","keywords":["Go"],"articleSection":["Web Dev"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/","url":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/","name":"Embedding Assets in Go - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","datePublished":"2015-11-12T12:59:57+00:00","dateModified":"2015-12-16T08:48:17+00:00","description":"In this article, I\u2019m going to show you how to embed assets in Go. In particular, I\u2019ll walk you through the process I used to embed a shell script into","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/web-dev-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/web-development\/embedding-assets-go\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Web Dev","item":"https:\/\/www.webcodegeeks.com\/category\/web-development\/"},{"@type":"ListItem","position":3,"name":"Embedding Assets in Go"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/1e4d5f11775e556ed3b14ac770759eed","name":"Mathias Lafeldt","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f7902955e0a00b4f39956366cc4b644a256944a2e6dcc6258e7e2393fad6dbe0?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f7902955e0a00b4f39956366cc4b644a256944a2e6dcc6258e7e2393fad6dbe0?s=96&d=mm&r=g","caption":"Mathias Lafeldt"},"description":"Mathias is an infrastructure developer at Jimdo with a preference for Ruby and Go. He writes about programming at mlafeldt.github.io.","sameAs":["http:\/\/mlafeldt.github.io\/","https:\/\/x.com\/mlafeldt"],"url":"https:\/\/www.webcodegeeks.com\/author\/mathias-lafeldt\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/8337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/115"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=8337"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/8337\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/927"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=8337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=8337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=8337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}