Go Little Tip

Source: Internet
Author: User
This is a creation in Article, where the information may have evolved or changed.

There are some branches on code.google.com

Some function functions that have not yet been merged into the default

Like Net/websocket.

Http://code.google.com/p/go/source/browse?repo=net#hg%2Fwebsocket

The availability of these libraries is high and is ideal for direct use

How to add patches to go

Http://golang.org/doc/contribute.html

Three runs of CMD:

Func (*cmd) Start

Func (*cmd) Run

Func (*cmd) Wait

Start: Run without waiting for process to end

Run: Running wait process end

Wait: waits for process to end

That means run = Start + Wait

The properties in cmd:

Process: Once start is started, process can be used

Processstate: This property can only be used after the process has ended. That must be run or start+wait to use.

String if there are "words, you can use ' to include

Like what:

Jsonstring: = '
{
"Development": {
"Connector": [
{"id": "connector-server-1", "host": "127.0.0.1", "Port": 4050, "Wsport": 3050},
{"id": "connector-server-2", "host": "127.0.0.1", "Port": 4051, "Wsport": 3051},
{"id": "connector-server-3", "host": "127.0.0.1", "Port": 4052, "Wsport": 3052}
],
"Gate": [
{"id": "gate-server-1", "host": "127.0.0.1", "Wsport": 3014}
]
}
}`

Http://golang.org/doc/faq#nil_error

Trap for Error interface

Your own definition of the error interface needs to be aware that the interface is two attributes, type and value, when both type and value are nil, it will only be ==nil if the interface inherits from Nil, even if Val is nil, but type is nil type.

For example, this post is asking this question:

Https://groups.google.com/forum/?fromgroups=#!topic/golang-nuts/59GXbVgxCxk


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.