From ac7b7fd4c2c94cd98005641c1cc7ad13a4884dc4 Mon Sep 17 00:00:00 2001 From: Sergey Bobrenok Date: Fri, 23 Aug 2024 00:09:55 +0300 Subject: [PATCH] Update README to include Go 1.23.0 section Recent changes [1] in go liker breaks `anet` build with go 1.23.0. An information about how to deal with it should be helpful. [1] https://github.com/golang/go/issues/67401 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5ec331a..93fe68b 100644 --- a/README.md +++ b/README.md @@ -118,3 +118,9 @@ fe80::7e4f:4446:eb3:1eb8/64 ## Other issues due to #40569 - https://github.com/golang/go/issues/68082 + +## How to build with Go 1.23.0 or later +The `anet` library internally relies on `//go:linkname` directive. Since the usage of `//go:linkname` has been restricted since Go 1.23.0 ([Go 1.23 Release Notes](https://tip.golang.org/doc/go1.23#linker)), it is necessary to specify the `-checklinkname=0` linker flag when building the `anet` package with Go 1.23.0 or later. Without this flag, the following linker error will occur: +``` +link: github.com/wlynxg/anet: invalid reference to net.zoneCache +```