godoc won't return packages list
Build version go1.11.5.
go env:
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\dell\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=E:\Go work
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\dell\AppData\Local\Temp\go-build908876718=/tmp/go-build -gno-record-gcc-switches
Currently learning go, checking go packages docs a lot, so I am trying to start a local go docments server using godoc. the command I am using is:
godoc -http=:54321
The server started without problem, but when I click the "Packages" button on top of the page or visit localhost:54321 it gave me this:
\src\temp.go:1:1: expected 'package', found 'EOF'
instead of packages list like the online doc. But if I visit http://localhost:54321/pkg/io/ or any other packages directly it works fine.
I have an empty temp.go file under my e:\go work\src, so I am pretty sure that's where the error coming from.
What I want is godoc return package list when I visit http://localhost:54321/pkg/, just like visit the online doc https://golang.org/pkg/