Go standard library documentation for older Go versions

400 views
Skip to first unread message

aco...@redhat.com

unread,
Oct 16, 2018, 10:38:10 AM10/16/18
to golang-nuts
I have not been able to find online API doc for older Go standard library versions, where would I find this? Apologies if it's in an obvious place and I missed it.

I would love it if the https://golang.org/pkg/ documentation had "introduced in version..." notations like https://docs.python.org or https://en.cppreference.com - but I'll settle for easy access to docs for older versions.

Minor nit: the release notes in the release history link to https://golang.org/pkg/ which is not really correct. The latest version could have made further changes to the API since that release which would be confusing.

Wojciech S. Czarnecki

unread,
Oct 16, 2018, 11:25:40 AM10/16/18
to golan...@googlegroups.com, aco...@redhat.com
On Tue, 16 Oct 2018 07:38:09 -0700 (PDT)
aco...@redhat.com wrote:

> I have not been able to find online API doc for older Go standard library
> versions, where would I find this? Apologies if it's in an obvious place
> and I missed it.

Go library docs are sourced from the source, so all old docs are available
locally. Just deep clone the go repo, checkout version you're interested in
then point godoc there. I'd suggest to copy repo for "docs purposes" to avoid
accidental mismatch at pull time to your main go sources (it needs to be at
master branch, not at detached head).

so:

cd $mirror_path

# possibly make local go repo mirror

git clone https://github.com/golang/go

rsync -a go go4doc

cd go4doc

git checkout go1.5

# Note: checking out 'go1.5' You are in 'detached HEAD' state...
# HEAD is now at bb03defe93... [release-branch.go1.5] go1.5

# look up fmt as it was of go1.5 on terminal

godoc -goroot $mirror_path/go4doc fmt

# or point godoc webserver there:

godoc -goroot $mirror_path/go4doc -http localhost:1515

# then browse docs at localhost:1515
# eg. http://localhost:1515/doc/devel/release.html
#
# Docs front page is of release that built godoc, but docs
# come from the -goroot $mirror_path/go4doc

> but I'll settle for easy access to docs for older versions.

hope this helps,

--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE

Agniva De Sarker

unread,
Oct 16, 2018, 2:39:19 PM10/16/18
to golang-nuts
Online API docs are just for the latest release and the master branch. But if you have the version you want locally installed, you can just spin up godoc and point to the goroot and browse it.

> I would love it if the https://golang.org/pkg/ documentation had "introduced in version..." notations 

It already does. Example - https://golang.org/pkg/net/http/#SameSite

Jan Mercl

unread,
Oct 16, 2018, 2:44:27 PM10/16/18
to Agniva De Sarker, golang-nuts
On Tue, Oct 16, 2018 at 8:39 PM Agniva De Sarker <agniva.qu...@gmail.com> wrote:

> It already does. Example - https://golang.org/pkg/net/http/#SameSite

I cannot see anything like "introduced in version" at that page? Anyone knows why? (Using Chrome Verze 69.0.3497.100 (Oficiální sestavení) (64bitový))
--

-j

Alan Conway

unread,
Oct 16, 2018, 3:00:57 PM10/16/18
to 0xj...@gmail.com, agniva.qu...@gmail.com, golan...@googlegroups.com
Thanks for the helpful suggestions! The GO docs do indeed have a version on the right edge of the screen, I completely failed to see it. Exactly what I wanted. Also I appreciate the tip about downloading local sources, that's always handy. Sorry for the noise.

--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/ZLnpGoYL7X0/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages