{"@context":"https://w3id.org/codemeta/3.0","@type":"SoftwareSourceCode","identifier":"pkg:golang/cmd/doc","name":"cmd/doc","description":"Doc (usually run as go doc) accepts zero, one or two arguments.\n\nZero arguments:\n\nShow the documentation for the package in the current directory.\n\nOne argument:\n\nThe first item in this list that succeeds is the one whose documentation\nis printed. If there is a symbol but no package, the package in the current\ndirectory is chosen. However, if the argument begins with a capital\nletter it is always assumed to be a symbol in the current directory.\n\nTwo arguments:\n\nShow the documentation for the package, symbol, and method or field. The\nfirst argument must be a full package path. This is similar to the\ncommand-line usage for the godoc command.\n\nFor commands, unless the -cmd flag is present \"go doc command\"\nshows only the package-level docs for the package.\n\nThe -src flag causes doc to print the full source code for the symbol, such\nas the body of a struct, function or method.\n\nThe -all flag causes doc to print all documentation for the package and\nall its visible symbols. The argument must identify a package.\n\nFor complete documentation, run \"go help doc\".","license":"https://spdx.org/licenses/BSD-3-Clause","codeRepository":"https://cs.opensource.google/go/go","url":"https://cs.opensource.google/go/go","dateModified":"2025-10-03","datePublished":"2025-10-03","softwareHelp":{"@type":"WebSite","url":"https://pkg.go.dev/cmd/doc#section-documentation"},"applicationCategory":"go","runtimePlatform":"go","sameAs":["https://pkg.go.dev/cmd/doc"]}