]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/cgo: add srcdir & trimpath docs, sort options
authorIan Lance Taylor <iant@golang.org>
Tue, 1 Oct 2024 16:57:52 +0000 (09:57 -0700)
committerGopher Robot <gobot@golang.org>
Tue, 1 Oct 2024 22:52:54 +0000 (22:52 +0000)
Update the package docs:
* The -srcdir docs were accidentally lost in CL 68590.
* The -trimpath option was added in CL 266358 but not documented.
* The options were not sorted correctly.

Fixes #69730

Change-Id: I97320e0f4fb6aa47cb03d451f028d3d9d9b560f7
Reviewed-on: https://go-review.googlesource.com/c/go/+/616699
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
src/cmd/cgo/doc.go

index a2b69b20dcdc3a33b1c672dddb92b180d4770eba..9ff5fd41901c9034d72dc04f01b0795f1b82eda5 100644 (file)
@@ -545,15 +545,6 @@ The following options are available when running cgo directly:
                If there are any exported functions, write the
                generated export declarations to file.
                C code can #include this to see the declarations.
-       -importpath string
-               The import path for the Go package. Optional; used for
-               nicer comments in the generated files.
-       -import_runtime_cgo
-               If set (which it is by default) import runtime/cgo in
-               generated output.
-       -import_syscall
-               If set (which it is by default) import syscall in
-               generated output.
        -gccgo
                Generate output for the gccgo compiler rather than the
                gc compiler.
@@ -568,12 +559,25 @@ The following options are available when running cgo directly:
                Write out input file in Go syntax replacing C package
                names with real values. Used to generate files in the
                syscall package when bootstrapping a new target.
+       -importpath string
+               The import path for the Go package. Optional; used for
+               nicer comments in the generated files.
+       -import_runtime_cgo
+               If set (which it is by default) import runtime/cgo in
+               generated output.
+       -import_syscall
+               If set (which it is by default) import syscall in
+               generated output.
        -ldflags flags
                Flags to pass to the C linker. The cmd/go tool uses
                this to pass in the flags in the CGO_LDFLAGS variable.
        -objdir directory
                Put all generated files in directory.
        -srcdir directory
+               Find the Go input files, listed on the command line,
+               in directory.
+       -trimpath rewrites
+               Apply trims and rewrites to source file paths.
 */
 package main