[#41] Update `make godoc` target

Ideally, installing and using an external tool should not modify the
go.mod or go.sum files in anyway. Unfortunately, this may not be
completely possible until Go1.14
(https://github.com/golang/go/issues/30515). This change prevents the
godoc target from modifying the go.mod file, though there may still be
anomalies with modifying the go.sum file (e.g. this change).

Further, since the godoc tool defaults to -goroot=$(go env GOROOT), it
doesn't make sense to provide a default value for -goroot, as it may not
be what the user has set as $(go env GOROOT)

Change-Id: I92de6bf8af4c00464b857db363bd07fdb55ee143
This commit is contained in:
Ian Howell 2020-02-12 09:20:21 -06:00
parent 1399c569f4
commit 9d72a01fc3
2 changed files with 2 additions and 3 deletions

View File

@ -41,7 +41,6 @@ BUILDDIR = docs/build
REQUIREMENTSTXT := docs/requirements.txt
# Godoc server options
GD_GOROOT ?= /usr/lib/go # Godoc has trouble with symbolic links, some may need to use /usr/share/go
GD_PORT ?= 8080
.PHONY: depend
@ -143,10 +142,9 @@ docs:
.PHONY: godoc
godoc:
@go get golang.org/x/tools
@go install golang.org/x/tools/cmd/godoc
@echo "Follow this link to package documentation: http://localhost:${GD_PORT}/pkg/opendev.org/airship/airshipctl/"
@godoc -http=":${GD_PORT}" -goroot ${GD_GOROOT}
@godoc -http=":${GD_PORT}"
.PHONY: releasenotes
releasenotes:

1
go.sum
View File

@ -536,6 +536,7 @@ golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBn
golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a h1:mEQZbbaBjWyLNy0tmZmgEuQAR8XOQ3hL8GYi3J/NG64=
golang.org/x/tools v0.0.0-20190729092621-ff9f1409240a/go.mod h1:jcCCGcm9btYwXyDqrUWc6MKQKKGJCWEQ3AfLSRIbEuI=
gonum.org/v1/gonum v0.0.0-20190331200053-3d26580ed485/go.mod h1:2ltnJ7xHfj0zHS40VVPYEAAMTa3ZGguvHGBSJeRWqE0=
gonum.org/v1/netlib v0.0.0-20190313105609-8cb42192e0e0/go.mod h1:wa6Ws7BG/ESfp6dHfk7C6KdzKA7wR7u/rKwOGE66zvw=