This is a creation in
Article, where the information may have evolved or changed.
Follow the "code technique" to learn Golang language, lazy for many days, today continue to explain the type of Golang. Today, the string is explained.
Learning Golang Language (1): Hello World
Learning Golang Language (2): Variables
Le
This is a creation in
Article, where the information may have evolved or changed.
Previously seen in the performance comparison test article, is about node. js and Golang HTTP module, simple HelloWorld function, the original text in this:
http://www.cnblogs.com/QLeelulu/archive/2012/08/12/2635261.html#2447171
After this article, node. js and Golang are upgraded, node. JS is now 0.10, and
Install Golang
The http://golang.org/dl/can be downloaded to Golang. Installation Documentation: Http://golang.org/doc/install.
Hello Go
We first create a file Hello.go:
Copy Code code as follows:
Package Main
Import "FMT"
Func Main () {
Fmt. Printf ("Hello golang\n");
}
Execute this program:
Copy Code code as follow
There are a lot of ways to start booting under Linux , and here I use the way I write shell commands in /etc/rc.local .Here is my actual operation as an example, many places need to crossing themselves to adjust the information Oh!1. In the /etc/rc.local file, add the script that you want to execute.For example, what I'm going to do now is a script that starts with the Golang project:Ficowlogpath= "/home/ficow/autolaunchlog.txt" #launch ficow ' s blog
Golang Installation and ConfigurationDownload the installation file, currently the latest version is 1.4.2,go1.4.2.linux-amd64.tar.gz.Extract the installation files to the specified directory:1 sudo tar -zxvf go1. 4.2. Linux-amd64. tar. Gz-c/usr/local/Edit the/etc/profile file to add an environment variable:Export Goroot=/usr/local/goexport gobin= $GOROOT/binexport path= $PATH: $GOBINexport gopath= $HOME/goprojRecompile the/etc/profile file and try to
The decision to discard the mouse starts, so be prepared to use VIM.So how to build Golang environment in VIM?With Git in vogue, it's so easy to build a vim environment.And when Vim is built, it's basically no different from the IDE.Highlighting, auto-completion, automatic formatting, viewing definition jumps, grammar detection, etc.
Improved Syntax highlighting with items such as Functions, Operators, Methods.
Auto Completion Support viagocode
The text of this text connection is: http://blog.csdn.net/freewebsys/article/details/46683645 reprint please must indicate the source!1, download Community version ideahttps://www.jetbrains.com/idea/download/2, download pluginHttps://plugins.jetbrains.com/plugin/5047?pr=ideaInstall the jar directly.3, create Golang ProjectTo set the SDK directory:Enter project name:Completion of entry project:Set Project properties: (This step is important, otherwise
Compiling the installation from source codeInstall the GCC tool, because golang some of the features are written in C, so building a Golang compilation is a mustInstall gawk GCC MakeInstall the mercurial tool to use the HG command to extract the source code of the GolangInstall MercurialPick and extract, if your network speed is slow, this step will take a little more timecd/usr/-R release https://go.googl
Online currently can not find a complete Mac under the Golang environment configuration support, I configured the success, now collated to share out.Mac better install Xcode, as if it had dependenciesInstalling homebrewOpen terminal window, paste script execution/usr/bin/ruby-e "$ (curl-fssl https://raw.githubusercontent.com/Homebrew/install/master/install)"Install the latest version of the Go language, to the official website https://golang.org/dl/do
Previous wordsThe author is Golang brain remnant powder, this content may cause phper discomfort, please read carefully!Two days ago a colleague encountered a problem, need a can support upload, download the function of the HTTP server to do a data center. I just did, so I promised to give him a lift.HTTP server, the first thought is PHP + nginx. So open the first, write a PHP uploadAll right, write it! The demand is complete! Test it out!So start the
Download WebSocket PackageIf the download fails, it may be a wall.
Package golang.org/x/net/websocket:unrecognized Import Path "Golang.org/x/net/websocket" (https Fetch:get https:// Golang.org/x/net/websocket?go-get=1:dial TCP 216.239.37.1:443:CONNECTEX:A connection attempt failed because the Connec Ted Party didn't properly respond after a period of time, or established connection failed because connected host had FAI led to respond.)
Can try$ go get -u github.com/
Tags: hash table eth IMA query result PST EAL Select getsShare the Redis and MySQL connection pools implemented by Golang, which you can refer directly to the connection pool handle in your project to invoke the corresponding method.Give me a chestnut: 1 use of MySQL connection pool (1) Placing mysql.go in the project subdirectory (2) Import the connection pool handle to the place where it needs to be called DB (3) Call DB. Query () 2 Use of Redis co
Introduction
Golang Study notes-environment building Guide has explained how to build Golang development environment, and wrote a go program "Hello,world", but write code does not have a good IDE, no syntax highlighting, automatic completion, format adjustment, find functions and other functions, It's going to make everyone crazy, I used to do Java and. NET development, often with the IDE has eclipse, I
The original address: http://www.jb51.net/article/56828.htm, this article extracts the set of the part, and the small harmless error has been modified
Java has set set, and Golang No, today suddenly there is a need to a bunch of int slices to combine to heavy, depressed for a long time, their soil method is too high complexity, see the above post feel good happy:
The map in Golang is not allowed to be dupli
Tags: using the command python algorithm a database COM identity primary key key Java databaseBackgroundNavicat is the best of the MySQL visualizer, but in terms of the import and export of the view, it is handled in alphabetical order by the view name, and when the view is dependent, it will be an error during the import process. The previous one has been written in Python, but in the process of use, encountered XFFFD encoding, Python pymysql will crash directly. Found that
Configure GDB Debug Golang original link https://sourceware.org/gdb/wiki/BuildingOnDarwinBuilding gdb for Darwin under MacCreating the binary for Darwin isn ' t very difficult. Download a release snapshot or get the current source via GIT/CVS/FTP, then configure and make as usual.Building The 7.0 release unfortunately results in many "Warning:format not a string literal and no format arguments" warn Ings. This problem have been fixed in CVS. To avoid
Golang compiler installation and configuration
Golang currently has two compilations, one for Golang and the other for GNU Gccgo;
Golang official compiler installation and configuration
Install the GCC tool, because golang some of the features are written in C, so buil
This is a creation in
Article, where the information may have evolved or changed.
wget https://github.com/google/protobuf/releases/download/v2.6.1/protobuf-2.6.1.tar.gzTar zxvf protobuf-2.6.1.tar.gzcd protobuf-2.6.1./configuremakemake Installprotoc-h
Go get github.com/golang/protobuf/protoc-gen-gocd Github.com/golang/protobuf/protoc-gen-gogo buildgo installvi/etc/ Profile add $gopath/bin to the environment
This is a creation in
Article, where the information may have evolved or changed.
The third type of opening language is a bit negative, so it is not posted here. Interested in themselves can go to see https://andy-zhangtao.gitbooks.io/golang/content/. Anger and anger. After reading it, don't take it seriously. Just take the following things seriously.
Don't look at the content, just look at the title and thought it was a novel. If one day on the whim,
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.