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

add a few useful snippets #602

Merged
merged 2 commits into from
Nov 9, 2016
Merged

add a few useful snippets #602

merged 2 commits into from
Nov 9, 2016

Conversation

marklap
Copy link
Contributor

@marklap marklap commented Nov 3, 2016

Useful snippets to me that is.

@msftclas
Copy link

msftclas commented Nov 3, 2016

Hi @marklap, 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;

@@ -155,6 +155,18 @@
"test function": {
"prefix": "tf",
"body": "func Test$1(t *testing.T) {\n\t$0\n}"
},
"init function": {
"prefix": "finit",
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't init and main be better prefixes?

Copy link
Contributor Author

@marklap marklap Nov 4, 2016

Choose a reason for hiding this comment

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

Perhaps. But I assumed folks would have the same trouble that #225 addresses particularly with the main function snippet. So, I used fmain and to be consistent, I used finit as well. I'm used to the #225 problem because SublimeText has it too and I've gotten used to escaping out of the autocomplete. So, if folks think main and init are better prefixes... that's fine with me.

Copy link
Contributor

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

Choose a reason for hiding this comment

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

The issue with main and #225 is valid. But does that apply to init as well?
My only concern was discoverability of these snippets.

(Randomly picking Go extension users who have recently logged issues :) + people from the #225 thread )
@zmb3 , @atombender, @bennyscetbun, @kulshekhar, @freeformz, @patbaker82, @lukehoban
Thoughts?

Choose a reason for hiding this comment

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

All things considered, fmain and init seem like the most apt options

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fmain and init work for me.

Choose a reason for hiding this comment

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

Hi my thought on this one.
I like consistency and many dev does too.
main/init should be good except that the #225 is a real pain when using it
So fmain/finit works fine for me :)
But please. No fmain/init or main/finit :)

Copy link

Choose a reason for hiding this comment

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

I agree with @bennyscetbun.

Copy link
Contributor

Choose a reason for hiding this comment

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

Consistency does make sense and drive usability as well. Lets see if there is any other feedback over the weekend. I'll merge the PR (fmain and finit) on Monday if we don't hear anything more.

Choose a reason for hiding this comment

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

Given that 'test function' uses tf and 'goroutine function' uses gf, maybe the main function can use mf while the 'init' function can use init (if might not be the best choice 🙂)

Copy link
Contributor

Choose a reason for hiding this comment

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

sigh.. This takes me back to a programmer's hardest task. http://imgur.com/y3dhJFQ : Naming things.

Going with fmain and finit

@ramya-rao-a ramya-rao-a merged commit a0bd14e into microsoft:master Nov 9, 2016
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.

None yet

6 participants