4 ms·
You could use the following to get the path to your assets. import ( "go/build" "path/filepath" ) pkgInfo, err := build.Import
by shakesbeard 13y ago
You could use the following to get the path to your assets.
import (
"go/build"
"path/filepath"
)
pkgInfo, err := build.Import("github.com/minikomi/pipesock", "", 0)
if err != nil {
panic(err)
}
webDirPath := filepath.Join(pkgInfo.Dir, "default")
- minikomi 13y agoThat's a much cleaner idea, thanks. I'll investigate it. edit: Thanks, I went with this.
- deleted 13y ago[deleted]