golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.55k stars 520 forks source link

local copy of tour does not support generics #1410

Open dodumosu opened 1 year ago

dodumosu commented 1 year ago

creating a local/offline copy of the tour (via go install golang.org/x/website/tour@latest) works, but the local content does not contain anything on generics, and trying to run code that uses generics in the code runner gives an error. this is the console output from a run, showing the content is from 2021 (generics were released in 2022):

C:\Users\USER>tour
2022/10/30 09:20:08 Serving content from C:\Users\USER\go\pkg\mod\golang.org\x\website\tour@v0.0.0-20210616181959-e0d934b43647
2022/10/30 09:20:09 A browser window should open. If not, please visit http://127.0.0.1:3999
2022/10/30 09:20:10 accepting connection from: 127.0.0.1:58947
2022/10/30 09:20:26 accepting connection from: 127.0.0.1:58976

this is from the online tour: chrome_4tRX9xmqhc

this is from the local copy: chrome_P5noIzEbS0

since go.mod is set to Go 1.16, the included code runner doesn't support generics: chrome_3wShPvGfcu

gabrc52 commented 9 months ago

I do have the generics unit but the example code does not run:

image