Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7558545
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:23:52+00:00 2026-05-30T12:23:52+00:00

Lets assume that running go install -v importpath builds an executable and installs it

  • 0

Lets assume that running go install -v importpath builds an executable and installs it into $GOPATH/bin/program. The go tool is unable to install resource files. When I run the program, I would like it to access some resource files that are under $GOPATH/src/importpath.

What is the best way of accessing such resource files from the installed executable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T12:23:54+00:00Added an answer on May 30, 2026 at 12:23 pm

    This question has been asked multiple times on the go-nuts mailing list. The go tool doesn’t offer a direct way to distribute additional resources at the moment. However, there are two workarounds available:

    • write a simple script (awk should be sufficient) to convert any file into a .go file which just contains a single string constant and embed the file directly into the binary. This approach is used by the Camlistore project for example (camlistored/ui/fileembed.go). go-bindata does similar things.

    • go-tour and many other projects are currently using the Import function of the go/build package to search through all src/ folders listed in $GOPATH and $GOROOT to find the correct path of the package sources. Example: http://code.google.com/p/go-tour/source/browse/gotour/local.go?r=996704f8ef9e63949b3bc4d94b613ec4a7b5d99a#53

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Lets assume that I'm dealing with a service that involves sending large amounts of
Lets assume that a rule (or rule of thumb, anyway), has been imposed in
This is a question about generic c++ event driven applications design. Lets assume that
Lets assume a simple Spring MVC Controller that receives the ID of a domain
Lets assume i have a bill number that has 12 numbers: 823 45678912 My
(code examples are python) Lets assume we have a list of percentages that add
Lets assume that I have a computer which has a multicore processor and a
Let's assume that inside a Windows Form, I start a long-running task like this:
For the sake of argument , lets assume that I can't change my file
Lets assume that I have retrieved page html using HttpWebRequest & StreamReader . Now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.