Brother Lian Blockchain technology training share go language development environment

Source: Internet
Author: User
Tags sublime text

The go language, as a server programming language, is suitable for processing logs, data packaging, virtual machine processing, file system, distributed system, database agent, etc. in network programming, the go language is widely used in Web applications, API applications, download applications, etc. in addition, the go language is also available for in-memory databases and cloud platform areas, At present, many foreign cloud platforms are using go development.


Brothers even the go language + Blockchain training courses Total 22 weeks of study duration, divided into 9 learning stages, that is, the main blockchain language-go language development practice, Blockchain backend technology system-go Language high concurrency and server development, Go Development Zone block chain (blockchain cryptography, distributed programming, consensus algorithms, basic concepts, Golan Development), ETH and smart contracts and Dapp development, blockchain distributed application development, blockchain system framework development-Super ledger and Blockchain 3.0EOS, Go and blockchain interview enhancements and advanced enterprise-level project combat.

Basic development tools

Sublime Text2 Download

Why use sublime Text2? I believe many developers like lightweight tools, lots of chrome pages and lots of small and fine software are like editor, but most of all, Vim mode!


Install the package control

When open, press CTRL + ~ to open the command line, or in view->show console, copy the following code to execute


Import Urllib2,os,hashlib; h = ' 7183a2d3e96f11eeadd761d777e62404 ' + ' e330c659d4bb41d3bdf022e94cab3cd0 '; PF = ' package control.sublime-package '; IPP = Sublime.installed_packages_path (); Os.makedirs (IPP) if not os.path.exists (IPP) else None; Urllib2.install_opener (Urllib2.build_opener (urllib2. Proxyhandler ())); by = Urllib2.urlopen (' + pf.replace (', '%20 ')). read (); DH = hashlib.sha256 (by). Hexdigest (); Open (Os.path.join (IPP, PF), ' WB '). Write (by) if DH = = h else None; Print (' Error validating download (got%s instead of%s), please try manual install '% (DH, h) if DH! = H Else ' please rest Art Sublime Text to finish installation ')


Installing Gosublime, configuring


As the basis for the development of Go on St, must be installed, and then in the Settings-user write the following configuration, set a Golang workspace, so you can automatically prompt the import package of methods


{

"env": {

"Gopath": "~/workspace: $GS _gopath"

},

"Autocomplete_builtins": true,

"Autocomplete_suggest_imports": True

}


Installing Golint

Golint is used to detect grammatical problems, similar to jslint, but it hints at most of the variable name is not underlined Ah, and then give a suggested variable name, to write comments ah ... Of course, after writing the comments, using the godoc-http=:8081 (port optional) can be seen in the browser just hard to write the comments have generated a document


Golint filename1 filepath1//can specify directories or files with multiple parameters

It can be deployed to Gosublime or Fswatch.


Installing Goimporter

This is a more powerful tool than GOFMT, it will automatically modify the import of the package, or is very practical, not because the import of things useless, or use a package without import caused by the error, this is a good thing to save time, product small into many


After compiling, set a ln-s to the $gobin directory (or copy the past), and add Gosublime user-setting a line, good things ah ~


"Fmt_cmd": ["Goimports"]

Note: ln-s requires absolute path


Fswatch Hot Compilation


After the same build is connected to $gobin, or directory such as/usr/bin, Windows users that are recommended to $gobin, compile the time to go to build directly, do not compile the individual fswatch.go, because there are multiple package main files


When a directory execution Fswatch is required, it is automatically generated. Fswatch.json

Then, in the command, write the commands that need to be executed, see below


{

"Paths": [

"."

],

"Depth": 2,

"Exclude": [],

"Include": [

"\\. (GO|PY|PHP|JAVA|CPP|H|RB) $ "

],

"Command": [

"Bash",

"-C",

"Pgrep Server | Xargs kill && golint./&& Go build server.go &&./server "

],

"env": {


},

"Kill-signal": "Kill"

}

Note: command is written by itself, because this tool can not kill the startup process in my Mac, so I manually added the kill command, how to fix it is still studying the source code ~ ~


Incorporate golint into the monitoring directory for easy content modification


Supervisor

[Program:vehiclestat]

Command=~/workspace/yourprogram

Autostart = True

AutoRestart = True

Startsecs = 5

user = root

Redirect_stderr = True

Stdout_logfile =/var/log/supervisord/yourprogram.log

A more practical tool for monitoring processes, compared with nohup./xxx & It's a little more reassuring.


Other

Set current directory to $gopath


Alias gopath= ' export gopath= ' pwd ' && echo $GOPATH '

Especially suitable for a number of different directory go project, under each project run once Gopath, set up the current Gopath, very convenient.

high-energy early warning, brother even education blockchain live course August continues to hit the hot!

The original price of 1188 Yuan of 12 block chain advanced courses, now only need 1 Yuan!

Also can receive free "Go Language foundation actual combat project development" and "Go language Advanced Combat Project development" textbook Two!! Limited time limit!! First come first served!!

Http://www.ydma.cn/open/course/24

Follow brother Lian Blockchain technology public number get more technical dry Goods Oh!!!

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.