Idea to write some Golang/tricks

Source: Internet
Author: User
This is a created article in which the information may have evolved or changed.

I used Vscode to write Golang until someone suggested idea to me and was impressed by its strength. Share some of the idea's operations and techniques here (just say golang, but some techniques are equally effective in other languages).

  • Help-Keymap reference can open the PDF file for shortcut mapping

  • On the types, functions, variables, CTRL + The left mouse button can quickly show where they are used, a better point is to be able to display the variable read and write, which is very helpful to read the code. However, it is important to note that the operation of the address of the variable will also be judged as read

  • Adds a JSON tag to the struct. After each element consecutive ALT + SHIFT + left mouse button to add more than one cursor, enter the back quotation mark (') and J, this time the window will pop up, and then press TAB, all the elements will be complete tag

  • CTRL + SHIFT + I quick View function definition, do not need to jump to the definition file to view and then return to the file being edited, this feeling can not be more cool

  • Refactoring, shortcut key SHIFT + F6

  • ALT + F1 Expand the location of the current file in the project bar

  • File watchers plugin, set to call Gofmt and other tools to format code when files are saved, or to do other things

  • We often have to enter some repetitive code, such as determining if err is nil. Free your hands with live template (CTRL + J)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.