boyter / scc

Sloc, Cloc and Code: scc is a very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go
MIT License
6.79k stars 267 forks source link

go install github.com/boyter/scc/v3@latest isn't working since v3.4 #532

Closed PhilKrau closed 1 month ago

PhilKrau commented 1 month ago

Hey, I'm using scc inside a gitlab ci/cd-pipeline and all my pipelines are failing since the command go install github.com/boyter/scc/v3@latest isn't working anymore. Up until version 3.3.5 everything ran fine, now I get the following errors:

/go/pkg/mod/github.com/boyter/scc/v3@v3.4.0/processor/detector.go:6:2: package cmp is not in GOROOT (/opt/bitnami/go/src/cmp)
/go/pkg/mod/github.com/boyter/scc/v3@v3.4.0/processor/bloom.go:3:8: package math/rand/v2 is not in GOROOT (/opt/bitnami/go/src/math/rand/v2)
/go/pkg/mod/github.com/boyter/scc/v3@v3.4.0/processor/detector.go:9:2: package slices is not in GOROOT (/opt/bitnami/go/src/slices)

I would appreciate any kind of help since I'm not too versed in Go. I'm using Ubuntu 22.04 and go1.18.1 linux/amd64. Thanks in advance for any help

boyter commented 1 month ago

Version 3.3.5 was updated to use Go 1.22 since the version it was on at the time was due to be EOL.

All you would need do is update your Go version 1.22 or later (1.23 being the latest at the moment).

I will be updating it every now and then simply to ensure it gets the latest security patches, features and performance improvements. For the future checking https://github.com/boyter/scc/blob/master/go.mod will let you know what version you need to be building from.

PhilKrau commented 1 month ago

Managed to fix the issue, thank you very much !

boyter commented 1 month ago

You are welcome!