:Q ZmB+F _272`2M+2p2`bBQM ↵ Basic Types Slices Maps Channels Type Declarations //struct type type myType struct { embeddedType protectedMember int PublicMember string } //type type intList []int Functions func returnNumberOne() int { return 1 } // multiple return values func returnTwoInts() (int,int) { return 2,3 } // methods have receievers func (t *myType) getProt() int { return t.protectedMember }

type protGetter interface { // function signatures only getProt() int } Operators * & » & > >= x

<&^

precedence

+ - ! ^ * / % « + - | ^ == != < <= && || ^x = bitwise compliment of

Structure - Exectutable

var num int // declare an integer var num int = 1 // declare & initialize var num = 1 // type inferred num := 1 // short declaration var num, foo int = 1, 2 // multiple // Unicode works var 名 = "アラスカ" // constant const name = "golang" // group-declaration var ( foo int bar int = 1 baz = 2 ) const ( fooConst = iota // 0 barConst // 1 bazConst = "Baz" ) // camelCase when multi-word myFavoriteRodent = "gopher" // identifiers with uppercase first // letters are exported const PackageName = "my package" var BadIdea = "mutate from anywhere!"

package main import ( "pkg" "pkg2" ) import "fmt" //or one per-line const ( numberOne = 1 ) const hello = "Hello, 世界" //main.main required for executable func main() { // Code }

Short Declaration

Interfaces

Unary Multiplication Addition Comparison Logical

Declaration

// Can only use in function body x := aFunction() // type inferred // can "re-declare" with at least one // new variable var y int x, z := 1, 2 // ok x, y := 3, 4 // ERROR // creates block-local variables for i:= 0 ; i < 10; i++ { fmt.Println(i) } fmt.Println(i) // ERROR // beware of shadowing Iota

Structure - Package package mylib func CallMeFromOutside Format verbs Simpler than Cās MOAR TABLE

package anothermain import ( "fmt" ) func main() { fmt.Println("Gopher, save me") }

Go Quick Reference Go Quick Reference Go Quick Reference - GitHub

Structure - Package package mylib func CallMeFromOutside. Format verbs. Simpler than Cās. MOAR TABLE package anothermain import (. "fmt". ) func main() {.

191KB Sizes 12 Downloads 449 Views

Recommend Documents

LIKWID | quick reference - GitHub
likwid-memsweeper Sweep memory of NUMA domains and evict cache lines from the last level cache likwid-setFrequencies Control the CPU frequency and ...

Log4j Quick Reference Card - GitHub
log4j.appender.socket.port=10005 log4j.appender.socket.locationInfo=true log4j.logger.com.my.app=DEBUG. Level. Description. ALL. Output of all messages.

Quick Reference Guide* * * * * * * * * * * * * * * * * * * * * Nutrition and ...
Fruit seeds and cores. ○ Chocolate. ○ Onions. ○. ○ Tomatoes(plants are toxic )ripe tomatoes small amounts fine. ○ Heavy wheat and flour based foods.

Quick Reference Guide.pdf
o Contact the ThunderRidge HS Portal Manager at [email protected]. Student Portal Account and Student Moodle Account. Username = Last Name ...

CustomGuide Quick Reference
To Delete a Message: Select the message and ... http://login.customguide.com/HancockCountySchools ... from the contextual menu, and select Clear Flag.

Quick Reference Guide.pdf
example, multiple Ziploc bags with socks in each), you only need to enter once and choose the correct. quantity. The system will create multiple line items/tags ...

Garmin 430W Quick Reference Guide.pdf
WARNING: Do not use data link weather information for. maneuvering in, near, or around areas of hazardous weather. Information contained within data link ...

Javascript Quick Reference Card - Cheat-Sheets.org
Code Structure var ... //Global variable ... //your code here. }] aName='ExplainThat!'; ..... pathname – the path to the document on the host protocol – the protocol ...

RollCall Attendance Quick Reference Guide.pdf
participation of students. How to Get Started - Login to Canvas through the Mesa Community College home page, mesacc.edu. Additional Resources – Visit the ...

2017 Quick Reference letter size.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. 2017 Quick Reference letter size.pdf. 2017 Quick Reference letter size.pdf. Open. Extract. Open with. Sign I

Quick Reference Sheet v2.1.pdf
Overload Bonus 100% Armor HP 100%. Bomb/Smrt Bomb Dmg100% Signature Rad. -50%. Smart Bomb Rng 100% Small Wp. Dmg 200%. EWAR Types.

Subaward Invoicing Quick Reference Guide_Jan2015.pdf ...
Page 1 of 2. NYU Program Services Oce. FAQs. What is flextecs? The subaward invoicing system. uses a software called flextecs to. manage the payments of.

Know Your Customer: Quick Reference Guide - PwC
Jan 1, 2014 - regarded as bank customer according to the Article 76 of Banking Law. ...... of preventative medicine, medical diagnosis, medical research, the ...

SENIOR QUICK REFERENCE GUIDE.pdf
There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. SENIOR QUICK ...

Chronical Quick Reference Guide.pdf
tube, use food grade silicone grease, Star San, or water as a lubricant. In the event you need to replace the O-ring inside the 1⁄2” threaded adapter,. spares are available on our site at www.ssbrewtech.com . We recommend that you orient the rack

VoiceThread Quick Reference Guide.pdf
Below the file use the Comment Toolbar to choose. your comment format. 3. Use the instructions for each commenting tool to leave. your comments. Note: Use the arrows to advance to the next slide to. leave comments. Learn more about commenting: http:/

Concussion quick reference guide.pdf
Br J Sports Med 47 (5), 2013. RECOGNIZE & REMOVE. Concussion should be suspected if one or more of the following visible clues,. signs, symptoms or errors ...

Know Your Customer: Quick Reference Guide - PwC
Jan 1, 2014 - Key sources of practical guidance with regard to AML requirements .... an account opened in the customer's name with a credit institution.