简体   繁体   English

更新 Git fork 的资产路径

[英]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.这样做的问题是,如果有人分叉我的 repo,它将引用我的资产而不是他们的资产,并可能最终出现错误。

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.或者它必须作为依赖项生成或下载,例如 Go 模块的一部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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