Go
Development setup
The layout of the Fuchsia checkout is not compatible out-of-the-box with
standard Go tooling like go test
and gopls
(the Go language server).
To set up your workspace for compatibility with Go tooling, run fx setup-go
.
This will create all of the symlinks and other files necessary for Go tooling
and to work and be compatible with IDEs.
Note that this is only necessary if you care about IDE features and/or running
go
commands directly. If you're happy without IDE features and with using fx
set
, fx build
, and fx test
to work with Go, feel free to skip this setup.
Editor configuration
Your editor needs to be configured to properly use Fuchsia-vendored Go build
tooling. In particular:
- The GOROOT needs to be set to the Fuchsia-aware GOROOT (likely to be
$FUCHSIA_DIR/out/default/host-tools/goroot
, though make sure to substitute
$FUCHSIA_DIR
for the actual path and out/default
for the GN out directory
you are using).
- "fuchsia" needs to be added to the go build tags.
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-03-15 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
{"lastModified": "Last updated 2024-03-15 UTC."}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-03-15 UTC."],[],[]]