OnWorks favicon

godoc - Online in the Cloud

Run godoc in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command godoc that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator



godoc - extracts and generates documentation for Go programs


godoc [flag] command [ name ... ]


Godoc extracts and generates documentation for Go programs.

It has two modes.

Without the -http flag, it runs in command-line mode and prints plain text documentation
to standard output and exits. If both a library package and a command with the same name
exists, using the prefix cmd/ will force documentation on the command rather than the
library package. If the -src flag is specified, godoc prints the exported interface of a
package in Go source form, or the implementation of a specific exported language entity:

godoc fmt # documentation for package fmt
godoc fmt Printf # documentation for fmt.Printf
godoc cmd/go # force documentation for the go command
godoc -src fmt # fmt package interface in Go source form
godoc -src fmt Printf # implementation of fmt.Printf

In command-line mode, the -q flag enables search queries against a godoc running as a
webserver. If no explicit server address is specified with the -server flag, godoc first
tries localhost:6060 and then http://golang.org.

godoc -q Reader
godoc -q math.Sin
godoc -server=:6060 -q sin

With the -http flag, it runs as a web server and presents the documentation as a web page.

godoc -http=:6060

By default, godoc looks at the packages it finds via $GOROOT and $GOPATH (if set).
Additional directories may be specified via the -path flag which accepts a list of colon-
separated paths; unrooted paths are relative to the current working directory. Each path
is considered as an additional root for packages in order of appearance. The last
(absolute) path element is the prefix for the package path. For instance, given the flag


for a godoc started in /home/user/godoc, absolute paths are mapped to package paths as

/home/user/godoc/x -> godoc/x
/home/bar/x -> bar/x
/public/x -> public/x

When godoc runs as a web server and -index is set, a search index is maintained. The index
is created at startup.

The index contains both identifier and full text search information (searchable via
regular expressions). The maximum number of full text search results shown can be set with
the -maxresults flag; if set to 0, no full text results are shown, and only an identifier
index but no full text search index is created.

The presentation mode of web pages served by godoc can be controlled with the "m" URL
parameter; it accepts a comma-separated list of flag names as value:

all show documentation for all declarations, not just the exported ones

show all embedded methods, not just those of unexported anonymous fields

src show the original source code rather then the extracted documentation

text present the page in textual (command-line) form rather than HTML

flat present flat (not indented) directory listings using full paths

For instance, http://golang.org/pkg/math/big/?m=all,text shows the documentation for all
(not just the exported) declarations of package big, in textual form (as it would appear
when using godoc from the command line: "godoc -src math/big .*").

By default, godoc serves files from the file system of the underlying OS. Instead, a .zip
file may be provided via the -zip flag, which contains the file system to serve. The file
paths stored in the .zip file must use slash ('/') as path separator; and they must be
unrooted. $GOROOT (or -goroot) must be set to the .zip file directory path containing the
Go root directory. For instance, for a .zip file created by the command:

zip go.zip $HOME/go

one may run godoc as follows:

godoc -http=:6060 -zip=go.zip -goroot=$HOME/go

See "Godoc: documenting Go code" for how to write good comments for godoc:


-v verbose mode

-q arguments are considered search queries: a legal query is a single identifier (such
as ToLower) or a qualified identifier (such as math.Sin).

-src print (exported) source in command-line mode

width of tabs in units of spaces

show timestamps with directory listings

-index enable identifier and full text search index (no search box is shown if -index is
not set)

glob pattern specifying index files; if not empty, the index is read from these
files in sorted order

index throttle value; a value of 0 means no time is allocated to the indexer (the
indexer will never finish), a value of 1.0 means that index creation is running at
full throttle (other goroutines may get no time while the index is built)

write index to a file; the file name must be specified with -index_files

maximum number of full text search results shown (no full text index is built if
maxresults <= 0)

additional package directories (colon-separated)

-html print HTML in command-line mode

Go root directory

HTTP service address (e.g., '' or just ':6060')

webserver address for command line searches

directory containing alternate template files; if set, the directory may provide
alternative template files for the files in $GOROOT/lib/godoc

print to standard output the data that would be served by an HTTP request for path

zip file providing the file system to serve; disabled if empty

Use godoc online using onworks.net services

Free Servers & Workstations

Download Windows & Linux apps

  • 1
    Fork of TeamWinRecoveryProject(TWRP)
    with many additional functions, redesign
    and more Features:Supports Treble and
    non-Treble ROMsUp-to-date Oreo kernel,
    Download OrangeFox
  • 2
    itop - ITSM  CMDB OpenSource
    itop - ITSM CMDB OpenSource
    IT Operations Portal: a complete open
    source, ITIL, web based service
    management tool including a fully
    customizable CMDB, a helpdesk system and
    a document man...
    Download itop - ITSM CMDB OpenSource
  • 3
    Clementine is a multi-platform music
    player and library organizer inspired by
    Amarok 1.4. It has a fast and
    easy-to-use interface, and allows you to
    search and ...
    Download Clementine
  • 4
    ATTENTION: Cumulative update 2.4.3 has
    been released!! The update works for any
    previous 2.x.x version. If upgrading
    from version v1.x.x, please download and
    Download XISMuS
  • 5
    Modular headtracking program that
    supports multiple face-trackers, filters
    and game-protocols. Among the trackers
    are the SM FaceAPI, AIC Inertial Head
    Tracker ...
    Download facetracknoir
  • 6
    PHP QR Code
    PHP QR Code
    PHP QR Code is open source (LGPL)
    library for generating QR Code,
    2-dimensional barcode. Based on
    libqrencode C library, provides API for
    creating QR Code barc...
    Download PHP QR Code
  • 7
    Cuckoo Sandbox
    Cuckoo Sandbox
    Cuckoo Sandbox uses components to
    monitor the behavior of malware in a
    Sandbox environment; isolated from the
    rest of the system. It offers automated
    analysis o...
    Download Cuckoo Sandbox
  • More »

Linux commands

  • 1
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    Run acl_gran
  • 2
    rsbac-admin - Rule Set Based Access
    Control DESCRIPTION: rsbac-admin is a
    set of tool used to manage systems using
    a Rule Set Based Access Control (RSBAC)
    Run acl_grant
  • 3
    cpupower idle-set - Utility to set cpu
    idle state specific kernel options
    SYNTAX: cpupower [ -c cpulist ]
    idle-info [options] DESCRIPTION: The
    cpupower idle-se...
    Run cpupower-idle-set
  • 4
    cpupower-info - Shows processor power
    related kernel or hardware
    configurations ...
    Run cpupower-info
  • 5
    g15daemon - provides access to extra
    keys and the LCD available on the
    logitech G15 keyboard. DESCRIPTION:
    G15Daemon allows users access to all
    extra keys by d...
    Run g15daemon
  • 6
    laditools - tools to control and
    monitor LADI (JACK and ladish) systems ...
    Run g15ladi
  • More »