Skip to content
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

[BUG] Can't lint go 1.22 package #19

Closed
Crocmagnon opened this issue Apr 22, 2024 · 4 comments
Closed

[BUG] Can't lint go 1.22 package #19

Crocmagnon opened this issue Apr 22, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Crocmagnon
Copy link

Crocmagnon commented Apr 22, 2024

Describe the bug
I'm trying to lint a module requiring go 1.22.
Log:

$ spancheck ./...
2024/04/22 10:44:34 [WARN] invalid start span signature "". expected regex:telemetry-type
/tmp/test/main.go:1:1: package requires newer Go version go1.22
ctrlflow: analysis skipped due to errors in package
spancheck: failed prerequisites: [email protected]/test

To Reproduce
go.mod:

module example.com/test

go 1.22.2

main.go:

package main

import "fmt"

func main() {
	fmt.Println("hello, world")
}

Expected behavior
The package should be linted properly and, in this case, not report any error.
Also there's an unexpected warning about the new start span signature.

Additional context
I installed spancheck with go1.22.2:

$ go version
go version go1.22.2 darwin/arm64
$ go install github.com/jjti/go-spancheck/cmd/spancheck@latest
@Crocmagnon Crocmagnon added the bug Something isn't working label Apr 22, 2024
@jjti
Copy link
Owner

jjti commented Apr 22, 2024

Aside that's unrelated to the primary go version at hand, that WARN log line is from a small bug, just fixed that: #20

@jjti
Copy link
Owner

jjti commented Apr 22, 2024

@Crocmagnon I'm unfortunately unable to reproduce, running below:

# josh @ M-FTQC4VW0R3 in ~/Desktop/main-test on git:main x [19:25:04] 
$ go version                                                  
go version go1.22.2 darwin/arm64

# josh @ M-FTQC4VW0R3 in ~/jjti/go-spancheck on git:jjti/fix-warn-start-span o [19:15:06] 
$ go install github.com/jjti/go-spancheck/cmd/spancheck@latest
go: downloading github.com/jjti/go-spancheck v0.6.1

# josh @ M-FTQC4VW0R3 in ~/Desktop/main-test on git:main x [19:20:53] 
$ cat go.mod 
module github.com/jjti/test

go 1.22.2

# josh @ M-FTQC4VW0R3 in ~/Desktop/main-test on git:main x [19:20:55] 
$ ls
go.mod  main.go

# josh @ M-FTQC4VW0R3 in ~/Desktop/main-test on git:main x [19:20:56] 
$ cat main.go 
package main

import "fmt"

func main() {
        fmt.Println("hello, world")
}

# josh @ M-FTQC4VW0R3 in ~/Desktop/main-test on git:main x [19:20:58] 
$ spancheck ./...

@Crocmagnon
Copy link
Author

Crocmagnon commented Apr 23, 2024

I tried cloning the repo and building it with my local toolchain (go 1.21), I'm getting the same error as reported.
I then updated the toolchain to go1.22.2 with go get toolchain@latest and after building I'm still getting the same error.
However, if I instead update the go.mod to go1.22.2 (go get go@latest) and build, I'm not getting any error.

Finally, I tried to install go-spancheck with the go1.22 toolchain after cleaning the modcache, but I'm getting the same error as reported.

Tested on master, commit 1288474

@jjti
Copy link
Owner

jjti commented Nov 30, 2024

@Crocmagnon I'm sorry to say I could never repro this issue. But I just upgraded the go version to 1.22.1 (in line with testifylint). Please let me know if you see the issue still after upgrading: 926dd06

@jjti jjti closed this as completed Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants