Go Bootcamp

 2

Go Bootcamp

Everything you need to know to get started with Go.

Matt Aimonetti

ii

Contents

Preface

v

1 Intro

1

1.1 Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.1.1 Knowledge . . . . . . . . . . . . . . . . . . . . . . . 2

1.1.2 Skills . . . . . . . . . . . . . . . . . . . . . . . . . . 2

1.1.3 Attitudes . . . . . . . . . . . . . . . . . . . . . . . . 3

2 The Basics

5

2.1 Variables & inferred typing . . . . . . . . . . . . . . . . . . . 5

2.2 Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.3 Printing Constants and Variables . . . . . . . . . . . . . . . . 8

2.4 Packages and imports . . . . . . . . . . . . . . . . . . . . . . 9

2.5 Code location . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.6 Exported names . . . . . . . . . . . . . . . . . . . . . . . . . 11

2.7 Functions, signature, return values, named results . . . . . . . 12

2.8 Pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14

2.9 Mutability . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

3 Types

17

3.1 Basic types . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.2 Type conversion . . . . . . . . . . . . . . . . . . . . . . . . . 18

3.3 Type assertion . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.4 Structs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.5 Initializing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

iii

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download