-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Closed
Labels
Description
What version of Go are you using (go version
)?
$ go version go version go1.13.1 linux/amd64
Does this issue reproduce with the latest release?
What operating system and processor architecture are you using (go env
)?
go env
Output
$ go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/home/gslab/.cache/go-build" GOENV="/home/gslab/.config/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="linux" GONOPROXY="" GONOSUMDB="" GOOS="linux" GOPATH="/home/gslab/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/home/gslab/terra:/usr/local/go/bin:/home/gslab/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/go" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64" GCCGO="gccgo" AR="ar" CC="gcc" CXX="g++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build889549718=/tmp/go-build -gno-record-gcc-switches"
What did you do?
I'm working on Github Api's with Go,
Code is as follow ---->
package main
import (
"context"
"fmt"
"os"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
)
type Package1 struct {
FullName string
Description string
ForksCount int
}
func main() {
ctx := context.Background()
ts := oauth2.StaticTokenSource(&oauth2.Token{AccessToken: os.Getenv("Github_Token")})
tc := oauth2.NewClient(ctx, ts)
client := github.NewClient(tc)
//list all repos for authenticated user
repos, _, err := client.Repositories.Get(ctx, "Mohitp98", "Appin2018")
//fmt.Println(os.Getenv("Github_Token"))
if err != nil {
fmt.Printf("Problem occured while getting info %v \n", err)
os.Exit(1)
}
pack := &Package1{
FullName: *repos.FullName,
Description: *repos.Description,
ForksCount: *repos.ForksCount,
}
fmt.Printf("%v\n", pack)
}
ERROR --->
go list failed on /usr/local/go/src/runtime: go: inconsistent vendoring in /usr/local/go/src:
go.mod requires github.com/google/go-github v17.0.0+incompatible but vendor/modules.txt does not include it.
run 'go mod tidy; go mod vendor' to sync