Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test: Go - support ongoing maintenance #12654

Closed
chrmarti opened this issue Sep 26, 2016 · 1 comment
Closed

Test: Go - support ongoing maintenance #12654

chrmarti opened this issue Sep 26, 2016 · 1 comment
Assignees
Milestone

Comments

@chrmarti
Copy link
Collaborator

chrmarti commented Sep 26, 2016

Pre-requisites for testing Go extension if you don't already have Go installed and the extension set up

  1. Install Go
  2. Setup GOPATH
    1. Choose a folder where you will be having the Go projects
    2. Add env variable GOPATH with value as the above folder path
    3. Create 3 folders "src", "bin" and "pkg"
  3. Run go get github.com/golang/example/hello
  4. Sideload the Go extension and open the folder $GOPATH/src/GitHub.com/golang/example in VS Code
  5. Open any Go file. You will see "Analysis Tools Missing" in the status bar. Click on it to install the Go tools that the extension needs.

Fix installation when goimports is the chosen formatting tool

  1. Make a change in any of the Go file (hello.go), format the document, ensure formatting works
  2. Add this in the User Settings: "go.formatTool": "goimports" and repeat the above
  3. You should see an info box pop up saying that "goimports" was not found. Ensure that the command it asks you to use is go get -v golang.org/x/tools/cmd/goimports
  4. Click on Install
  5. Try formatting again. This time it should work.

Fix installation in Windows when goreturns is the chosen formatting tool

  1. If you have goreturns installed already, then delete the exe
  2. Remove any customized setting you have for go.formatTool
  3. Make a change in any of the Go file (hello.go), format the document
  4. You should see an info box pop up saying that "goreturns" was not found. Ensure that the command it asks you to use is go get -v sourcegraph.com/sqs/goreturns
  5. Click on Install
  6. Try formatting again. This time it should work.

Add configurable flags for formatting
See PR 444 for testing steps

Use diff output from gorename to allow undo on rename operation

  1. Rename a local variable in any Go file (hello.go), using F2 or right-click -> Rename Symbol
  2. Rename should be a success, file should be in an unsaved state and Undo should work
  3. Rename a function that is used across files. Ensure not all files that should be affected are open.
  4. Rename should be a success, all affected files should be open and in unsaved state and Undo should work

Auto-complete for package names that are not imported.

  1. Set "go.autocompleteUnimportedPackages" in user settings
  2. Open a Go file that doesn't have the math import
  3. Type m, the auto-complete should give math as an option. Choose this option, the word will get completed and an import to math will be added to your go file

Auto-complete for methods from packages that are not yet imported.

  1. Set "go.autocompleteUnimportedPackages" in user settings
  2. Open a Go file that doesn't have the math import
  3. Type math., the auto-complete will give all methods from math package as options. Choose any, the word gets completed and an import to math will be added to your go file

Updates to running Go tests
Refer to PRs #478 and #499 to get testing steps

Generate Unit Tests
Run below commands on hello.go and ensure a hello_test.go with test skeletons gets created.
* Go: Generate unit tests for current file
* Go: Generate unit tests for current function
* Go: Generate unit tests for current package

Changes to GOROOT and GOPATH in setting take effect immediately

  1. Remove GOPATH env var. Launch VS Code. You should see the "GOPATH" not set message in the status bar
  2. Set GOPATH in User setting. You should be able to use all the Go extension features without needing to reload/restart VS Code

Do not allow to import already imported packages

  1. Open hello.go and run the command Go: Add Import
  2. Ensure the already imported packages like fmt and stringutil do not appear in the quick open
@ramya-rao-a
Copy link
Contributor

Testing completed.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
@roblourens roblourens removed their assignment Oct 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants