Before releasing a new version of the extension, please run the following smoke test to make sure that all features are working.
First, clone golang.org/x/example. At the time of writing (June 2020), this repository has not changed since 2017. If it has changed since, these steps may not be exactly reproducible and should be adjusted.
For now, we smoke test the extension only in GOPATH
mode.
If it does not already exist:
mkdir $GOPATH/src/github.com/golang
Then,
cd $GOPATH/src/github.com/golang git clone https://github.com/golang/example cd example
Next, build and sideload the modified Go extension and open the example/hello
directory. Open hello.go
.
fmt.Println
.stringutil.Reverse
.fmt.Println
.stringutil.Reverse
.fmt.Println
.stringutil.Reverse
.fmt.
.stringutil.
.main
function and type fmt.
.main
function and type parser.
. Expect suggestions from the unimported standard library go/parser
package.main
function and type fmt.
. Select the fmt.Println
completion and observe the outcome. Toggle the go.useCodeSnippetsOnFunctionSuggest
setting to ensure that placeholders are provided.fmt.Println
.stringutil.Reverse
.Enable go.buildOnSave
, go.vetOnSave
, and go.lintOnSave
.
Add var x int
to the main
function and expect a build diagnostic.
Add fmt.Printf("hi", 1)
and expect a vet diagnostic.
Add the following function to the bottom of the file and expect a lint diagnostic.
// Hello is hi. func Hi() {}
You can also try toggling the "package"
and "workspace"
configurations for these settings.
main
function and save. Expect formatting to remove all but one line."fmt"
import. Save and expect it to return."github.com/golang/example/stringutil"
import. Save and expect it to return.Go: Add Import
command works (add "archive/tar"
).Add the following to the main
function, then rename x
to y
.
var x int
fmt.Println(x)
Rename stringutil.Reverse
. reverse.go
and reverse_test.go
should be dirtied.