markbates / pkger

Embed static files in Go binaries (replacement for gobuffalo/packr)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pkger dies for private repos

phanirithvij opened this issue · comments

pkger is trying to fetch private repo for some reason even though I am in the diectory with go.mod file and it worked a few mins ago.

pkger

2020/11/02 03:44:17 here.Package: github.com/phanirithvij/btp/central: here.cache: github.com/phanirithvij/btp/central: [go list -json -find github.com/phanirithvij/btp/central] exit status 1: go: finding module for package github.com/phanirithvij/btp/central
go: downloading github.com/phanirithvij/btp v0.0.0-20201101220823-ec08d474b24d
github.com/phanirithvij/btp@v0.0.0-20201101220823-ec08d474b24d: verifying module: github.com/phanirithvij/btp@v0.0.0-20201101220823-ec08d474b24d: reading https://sum.golang.org/lookup/github.com/phanirithvij/btp@v0.0.0-20201101220823-ec08d474b24d: 410 Gone
        server response:
        not found: github.com/phanirithvij/btp@v0.0.0-20201101220823-ec08d474b24d: invalid version: git fetch -f origin refs/heads/*:refs/heads/* refs/tags/*:refs/tags/* in /tmp/gopath/pkg/mod/cache/vcs/e03cc0e76d6719fff4607e08020dc053279d9675b9950540a665877c05313412: exit status 128:
                fatal: could not read Username for 'https://github.com': terminal prompts disabled

I've even tried all the solutions mentioned at stackoverflow but pkger seems to ignore just about everything.

My go.mod file

module github.com/phanirithvij/btp/central

go 1.15

require (
	github.com/fsnotify/fsnotify v1.4.9 // indirect
	github.com/gin-gonic/gin v1.6.3
	github.com/go-playground/validator/v10 v10.4.1 // indirect
	github.com/gobuffalo/here v0.6.2 // indirect
	github.com/golang/protobuf v1.4.3 // indirect
	github.com/json-iterator/go v1.1.10 // indirect
	github.com/magiconair/properties v1.8.4 // indirect
	github.com/markbates/pkger v0.17.1
	github.com/mitchellh/go-homedir v1.1.0
	github.com/mitchellh/mapstructure v1.3.3 // indirect
	github.com/pelletier/go-toml v1.8.1 // indirect
	github.com/spf13/afero v1.4.1 // indirect
	github.com/spf13/cast v1.3.1 // indirect
	github.com/spf13/cobra v1.1.1
	github.com/spf13/jwalterweatherman v1.1.0 // indirect
	github.com/spf13/viper v1.7.1
	github.com/ugorji/go v1.1.13 // indirect
	golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect
	golang.org/x/sys v0.0.0-20201101102859-da207088b7d1 // indirect
	golang.org/x/text v0.3.4 // indirect
	google.golang.org/protobuf v1.25.0 // indirect
	gopkg.in/ini.v1 v1.62.0 // indirect
	gopkg.in/yaml.v2 v2.3.0 // indirect
)

File structure

.
├── go.mod
├── go.sum
└── server
    ├── main.go
    ├── pkged.go
    ├── server
    └── templates
        └── home.html
....

I'm trying to do a pkger -o server and the here.cache keeps on fecthing the repo even though I am currenly in the directory with go.mod file with github.com/phanirithvij/btp/central as the module

Seems like the issue is because there are no go files the top level directory containing go.mod file.
Creating one solved it.
golang/go#28928 (comment)