Sources won't compile (linux)
Hi, I tried to compile from sources (latest)
cd build
go build -ldflags="-s -w" ../src/sheret.go
All I got is
../src/sheret.go:20:3: cannot find package "github.com/pkg/browser" in any of:
(list of local go dependencies cache)
So there seem to be a missing dependance after all. I tried to remove the dep from the include list, but the so-called "browser" package is effectively in use, and another error arises. Any idea?
Hi, I had the same problem, it's because sheret depends on it, you have to download them.
Here, I got your back, do as following:
- Do
go get github.com/ethanpil/sheret/src. - Go to the
$GOPATH/src/github.com/ethanpil/sheret/src. - Download libraries with
go get(optional?). - Compile
go build -ldflags="-s -w" -o sheret sheret.go
Thanks for your answer. It's a little pity though, as the readme says "There are no dependencies.". I suspect it is more a packaging issue.
Good call. Since I added the open browser flag, there is now a dependency on the Browser package for cross platform browser open. I will investigate alternative. Is the zero dependency a real issue for you? Why?
Hi, The zero dependency is not such an issue, except that documentation advertises it. One of the quality of Go is its portability, and as no release executable is provided for Linux, I tried to compile the sources myself to get a monolithic executable to work on my servers. Usually a simple "go build" in the source directory is enough to get the compilation done. In this specific case, it crashes, and I don't know Go this well to know for sure what is going wrong. I think a little update of the documentation and a proper paragraph about compiling the project would be enough.
same issue on macos big sur: sheret.go:20:3: no required module provides package github.com/pkg/browser: go.mod file not found in current directory or any parent directory; see 'go help modules' how to fix the issue?
Thanks for letting me know. I will take a look when I have some time. May just be easier to sunset the Browser feature.
Is it fixed yet?
I think I will remove the Browser functionality and package dependency and release a new version. Also happy to accept a PR for this.
Hi @elmkni thanks for the updates. If you submit a PR I will merge it and release a new version.
Hi Ethan,
I've changed the dependencies from "github.com/pkg/browser" to "github.com/icza/gox/osx" because it is much smaller and has no sub-dependency itself! I also added the missing licenses for Go and Gox (they are actually compulsory) and edited 'release.bat' accordingly. I also bumped the version from '1.2' to '1.22' to reflect the changes I made! I've also added the go-1.20.5 compiled sheret binary v1.22 executable and release archive!
You may now merge my pull-request!
With best regards,
Elmar