logo
down
shadow

generate godoc documentation for an entire project?


generate godoc documentation for an entire project?

Content Index :

generate godoc documentation for an entire project?
Tag : go , By : Adam Hill
Date : November 26 2020, 01:01 AM

help you fix your problem
is there a canonical way to generate documentation for offline use even using godoc?

Comments
No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How do you serve simple documentation for go programs using godoc as a webpage?


Tag : go , By : wpoch
Date : March 29 2020, 07:55 AM
fixed the issue. Will look into that further godoc operates on package and type names, not filenames.
For example, to learn about io/ioutil package:
godoc hey/world

How to force Windows godoc to update private package documentation on local webserver in golang?


Tag : windows , By : MJRider
Date : March 29 2020, 07:55 AM
I think the issue was by ths following , Patrick's answer pointed me in the right direction. The solution was to move the entire package folder into another folder and then run the "godoc -http :6060" command again which forced the update.
For just creating a godoc, this works fine. You just can't actually build anything without changing imports or moving the folder back.

How can I jump to the documentation of the type of a field in a struct or a method I'm browsing in godoc?


Tag : go , By : wpoch
Date : March 29 2020, 07:55 AM

Godoc documentation not outputting lists


Tag : go , By : Doug
Date : March 29 2020, 07:55 AM
seems to work fine As others noted, "lists" in comments will not be turned into HTML lists (such as
    ,
      ).
      Recommended reading: Godoc: documenting Go code. Quoting from it:
      // Fv1 is just an example.
      //
      // Here's a list:
      //
      // -First item
      //
      // -Second item
      //
      // -Third item
      //
      // This is the closing line.
      
      // Fv1 is just an example.
      //
      // Here's a list:
      //
      // • First item
      //
      // • Second item
      //
      // • Third item
      //
      // This is the closing line.
      
      // Fv2 is just another example.
      //
      // Here's a list:
      //  -First item
      //  -Second item
      //  -Third item
      //
      // This is the closing line.
      
      -First item
      -Second item
      -Third item
      
      // Fv3 is just another example.
      //
      // Here's a list:
      //   -First item
      //     -First.First item
      //     -First.Second item
      //   -Second item
      //
      // This is the closing line.
      
      -First item
        -First.First item
        -First.Second item
      -Second item
      

How to serve documentation using godoc together with go modules?


Tag : go , By : RichAA
Date : March 29 2020, 07:55 AM
Hope this helps The issue isn't modules so much as GOPATH. There's a github issue thread that discusses this in more detail: https://github.com/golang/go/issues/26827
That thread has evolved a workaround that uses a docker container to run a godoc server with GOPATH set to the base of your dev tree. That godoc server will serve docs for all of the packages in your dev tree, regardless of whether they have a go.mod yet or not.
#!/bin/bash 

set -x  # optional

devbase=$HOME/gohack
port=6060

docker run \
    --rm \
    -e "GOPATH=/tmp/go" \
    -p 127.0.0.1:$port:$port \
    -v $devbase:/tmp/go/src/ \
    --name godoc \
    golang \
    bash -c "go get golang.org/x/tools/cmd/godoc && echo http://localhost:$port/pkg/ && /tmp/go/bin/godoc -http=:$port"
Related Posts Related QUESTIONS :
  • compile a go source file programmatically
  • What is the proper style and usage of golang Context?
  • golang find first element smaller or equal to given element using sort.Search
  • deadlock in golang
  • Unable to unmarshal AWS SQS message in GO
  • When does a channel block a goroutine
  • Why code in loop not executed when I have two go-routines
  • Read uint8 from []byte without creating a bytes.Buffer
  • Args and passing args from position[1] (not position 0)
  • How to keep single AWS S3 session in app?
  • How to convert int16 to hex-encoded string in Golang
  • Not able to encrypt using public key in golang
  • Go 1.12 modules: local import in non-local import
  • How to set a constant to negative value in Go
  • how to add new currency support to golang.org/x/text/currency
  • HTTP PUT request handler using go
  • How to defer an anonymous function returned by a function
  • Correct way of handling an error when implementing Less()
  • golang time.Format() gives different results for the same unix timestamp
  • How to make a function received different type as a string
  • How to compile a golang program within the golang code?
  • Find location of Golang application
  • Created a type alias for big.Int - but I can't Set it using its pointer receiver?
  • Should a developer commit Go generated code?
  • Go atomic store followed by atomic load is behaving erratically across routines
  • Two go files having package declaration main inside a package
  • Will go get command update the package in my local machine
  • Is the following implementation making my code parallel?
  • Is it possible to compile go code without builtin library that can run on a machine without operating system
  • Can I use an pointer to "error" to catch the return error?
  • Constant global user type values in Go
  • shouldn't unreachable code after os.Exit be flagged
  • How expensive is os.Getenv?
  • Conditional (Dynamic) Struct Tags
  • How to get info about last called func in Go?
  • Golang not incrementing by 0.1
  • How to set unique at struct Beego
  • How to use go importer
  • Output from benchmem
  • Generic panic recovering in go programs
  • Should database connections be opened and closed in every CRUD method?
  • Migrating your App Engine app from Go 1.9 to Go 1.11
  • How can I get the user's AppData folder path with golang?
  • Does delve support hot swapping of changes or some variant?
  • Address of Function Receiver Varies Between Methods
  • How to parse variable depth arrays into a struct from JSON
  • Building a small Go program for MIPS with no hardware floating point (softfloat required)
  • Go Interface property is undefined
  • Same package name on different files
  • How to stream result from grpc-server and how to return result from goroutines grpc server-stream to pass result to api
  • Golang detect if in focus or minimized
  • golang undefined: Scanner
  • Re-insert into channel causing deadlock
  • Idiomatic way to represent one of/union in Go
  • Why doesn't "go get" install the package to GOPATH?
  • What does "safely escaped with Go syntax" mean?
  • Function TestMain didn't run
  • Is it safe to remove dictionary keys while iterating over it?
  • grpc-go over https: failed rpc error: code = Unavailable desc = transport is closing:
  • what is the meaning of go syntax struct {}{}
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com