简体   繁体   中英

Updating a go asset path for Git forks

So I have this line in my code:

base := build.Default.GOPATH + "/src/github.com/skuzzymiglet/point/"

Later, I use it like this:

script, err := ioutil.ReadFile(base + "script.js")

The problem with this is if someone forks my repo, it will reference my assets not theirs, and possibly end up with an error.

How should I go about solving this problem?

it will reference my assets not theirs, and possibly end up with an error.

Then:

  • either that asset must be part of the repository being forked
  • or it must be generated or downloaded as a dependency, for instance part of a Go module.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM