Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Add benchmark function snippet #648

Merged
merged 1 commit into from
Nov 29, 2016
Merged

Conversation

pawelkowalak
Copy link
Contributor

Analogical to existing tf snippet.

@msftclas
Copy link

Hi @vIRu, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution!

This seems like a small (but important) contribution, so no Contribution License Agreement is required at this point. Real humans will now evaluate your PR.

TTYL, MSBOT;

@@ -156,6 +156,10 @@
"prefix": "tf",
"body": "func Test$1(t *testing.T) {\n\t$0\n}"
},
"benchmark function": {
"prefix": "bf",
"body": "func Benchmark$1(b *testing.B) {\n\tfor n := 0; n < b.N; n++ {\n\t\t$0\n\t}\n}"
Copy link
Contributor

@ramya-rao-a ramya-rao-a Nov 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow to change the variable n in the for loop here just like the for loop snippet. And name it i or index to begin with?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will change n to i, but allowing to change that variable doesn't make sense for benchmark functions as Go chooses value of b.N on its own.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed.

@ramya-rao-a ramya-rao-a merged commit b3b34d0 into microsoft:master Nov 29, 2016
@ramya-rao-a
Copy link
Contributor

@vIRu The latest update 0.6.51 has your snippet. Thanks for your contribution!

mattetti added a commit to mattetti/vscode-go that referenced this pull request Jan 11, 2017
* 'master' of github.com:mattetti/vscode-go: (128 commits)
  Add telemetry support for the Go extension
  Add dlv path to error msg when dlv not found
  Fixes microsoft#465 outline offset problem in No-English language (microsoft#699)
  fix coverage display when editor changes to undefined (microsoft#693)
  Add support for reading http.proxy setting (microsoft#639)
  Fixing flaky unit tests
  Refactor for corner cases
  Reduce noise in console log due to errors from hover
  Changelog for next update 0.6.51
  Remove space after brackets in snippet as per microsoft#628
  Fixes microsoft#647 Strip version from autocompleted pkgs from gopkg.in (microsoft#659)
  Fixes microsoft#647 Support vendor pkgs from root of GOPATH/src (microsoft#660)
  Fixes microsoft#640 Use spawn to handle big data from gocode (microsoft#661)
  Fixed wrong workspace when one gopath is the substring of another. (microsoft#658)
  Fix "gotests" when generates test for current function for type methods (microsoft#657)
  Add benchmark function snippet (microsoft#648)
  Fix "Go to Definition" when running Go HEAD (microsoft#655)
  Fixes microsoft#642 Only add -d once to formatflags (microsoft#644)
  Updating Changelog and package.json for 0.6.50 update
  Log errors to console
  ...
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants