opentelemetry-go icon indicating copy to clipboard operation
opentelemetry-go copied to clipboard

Do not use toolchain directive

Open pellared opened this issue 1 year ago • 6 comments

I think that go 1.21.0 is required for the bump and it should not be a problem..

However, I do not think we need to add toolchain go1.22.5. I think it would be better to avoid toolchain consistently in all our Go modules.

Originally posted by @pellared in https://github.com/open-telemetry/opentelemetry-go/pull/5643#discussion_r1698150685

We should have have some "linter" that would detect such changes.

pellared avatar Jul 31 '24 08:07 pellared

is this already fixed and merged?

pulin-dani avatar Aug 04 '24 04:08 pulin-dani

is this already fixed and merged?

From issue description:

We should have have some "linter" that would detect such changes

pellared avatar Aug 04 '24 10:08 pellared

With the upgrade of Go to 1.23, the use of toolchain seems to be required: https://github.com/open-telemetry/opentelemetry-go/pull/5720#discussion_r1721966833

MrAlias avatar Aug 19 '24 15:08 MrAlias

Closing this, as with Go 1.23, the toolchain directive is required and added automatically.

dmathieu avatar Aug 26 '24 13:08 dmathieu

Closing this, as with Go 1.23, the toolchain directive is required and added automatically.

It is still not required. See: https://github.com/open-telemetry/opentelemetry-go/pull/5784

There are more people complaining on the go get and go mod tidy behavior so maybe eventually they will stop automatically adding the toolchain directive. See: https://github.com/golang/go/issues/65847

pellared avatar Sep 05 '24 09:09 pellared

Dependabot update of opentelemetry packages added go toolchain for me:

  • https://github.com/cloudflare/ebpf_exporter/pull/471

It also fails to build and requires go mod tidy, which changes it further:

$ git diff
diff --git a/go.mod b/go.mod
index 86aefc2..2a91bad 100644
--- a/go.mod
+++ b/go.mod
@@ -1,7 +1,8 @@
 module github.com/cloudflare/ebpf_exporter/v2

-go 1.21
-toolchain go1.22.5
+go 1.22
+
+toolchain go1.23.1

No other dependency bump required this.

bobrik avatar Oct 01 '24 20:10 bobrik

I would like to work on this issue.

cheese-head avatar Nov 15 '24 23:11 cheese-head