Skip to content

bug: can't compile after using go get with master version #73001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
IndianMax03 opened this issue Mar 22, 2025 · 2 comments
Closed

bug: can't compile after using go get with master version #73001

IndianMax03 opened this issue Mar 22, 2025 · 2 comments

Comments

@IndianMax03
Copy link

Go version

go version go1.23.2 darwin/arm64

Output of go env in your module/workspace:

GO111MODULE=''
GOARCH='arm64'
GOBIN=''
GOCACHE='/Users/indianmax/Library/Caches/go-build'
GOENV='/Users/indianmax/Library/Application Support/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFLAGS=''
GOHOSTARCH='arm64'
GOHOSTOS='darwin'
GOINSECURE=''
GOMODCACHE='/Users/indianmax/go/pkg/mod'
GONOPROXY=''
GONOSUMDB=''
GOOS='darwin'
GOPATH='/Users/indianmax/go'
GOPRIVATE=''
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/opt/homebrew/Cellar/go/1.23.2/libexec'
GOSUMDB='sum.golang.org'
GOTMPDIR=''
GOTOOLCHAIN='local'
GOTOOLDIR='/opt/homebrew/Cellar/go/1.23.2/libexec/pkg/tool/darwin_arm64'
GOVCS=''
GOVERSION='go1.23.2'
GODEBUG=''
GOTELEMETRY='local'
GOTELEMETRYDIR='/Users/indianmax/Library/Application Support/go/telemetry'
GCCGO='gccgo'
GOARM64='v8.0'
AR='ar'
CC='cc'
CXX='c++'
CGO_ENABLED='1'
GOMOD='/Users/indianmax/Desktop/projects/tmp/test-tracker/go.mod'
GOWORK=''
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
PKG_CONFIG='pkg-config'
GOGCCFLAGS='-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -ffile-prefix-map=/var/folders/v5/r3q305vn4n363gd0tbkk7zqh0000gn/T/go-build1305438114=/tmp/go-build -gno-record-gcc-switches -fno-common'

What did you do?

Init & get module:

mkdir test-tracker
cd test-tracker
go mod init test-tracker
go get -u github.com/dvsnin/yandex-tracker-go@master

After that I wrote a program:

import (
	"fmt"
	"net/http"

	tracker "github.com/dvsnin/yandex-tracker-go"
)

func main() {
	client := tracker.New("stub", "stub", "")
	req := client.NewRequest(http.MethodGet, "/test", nil)
	fmt.Println(req)
}

My go.mod after go mod tidy:

module test-tracker

go 1.23.2

require github.com/dvsnin/yandex-tracker-go v1.0.5-0.20240229155352-2f9f3666291a

require (
	github.com/go-resty/resty/v2 v2.16.5 // indirect
	golang.org/x/net v0.37.0 // indirect
)

What did you see happen?

Trying to run a program:

$ go run main.go
# command-line-arguments
./main.go:12:16: client.NewRequest undefined (type tracker.Client has no field or method NewRequest)

As you can see there is no method NewRequest.
We can check local pkgs:

$ grep -rn "func " ~/go/pkg/mod/github.com/dvsnin/[email protected]/ | grep NewRequest
/Users/indianmax/go/pkg/mod/github.com/dvsnin/[email protected]//client.go:73:func (t *trackerClient) NewRequest(method, path string, opt interface{}) *resty.Request {

Method exists.

What did you expect to see?

Program runs correctly.

@seankhliao
Copy link
Member

it returns an interface without the method
https://github.com/dvsnin/yandex-tracker-go/blob/master/client.go#L21

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants