没有合适的资源?快使用搜索试试~ 我知道了~
Go - Golang - An Introduction to Programming in Go
0 下载量 189 浏览量
2024-06-30
10:06:36
上传
评论
收藏 2.77MB PDF 举报
温馨提示
试读
165页
Contents 1 Getting Started 1 1.1 Files and Folders 2 1.2 The Terminal 5 1.3 Text Editors 9 1.4 Go Tools 13 2 Your First Program 15 2.1 How to Read a Go Program 17 3 Types 23 3.1 Numbers 24 3.2 Strings 29 3.3 Booleans 31 4 Variables 35 4.1 How to Name a Variable 39 4.2 Scope 40 4.3 Constants 43 4.4 Defining Multiple Variables 44 4.5 An Example Program 45 5 Control Structures 47 5.1 For 48 5.2 If 51 5.3 Switch 55
资源推荐
资源详情
资源评论
An Introduction to Programming in Go
Copyright © 2012 by Caleb Doxsey
All rights reserved. No part of this book may be
reproduced or transmitted in any form or by any
means, electronic or mechanical, including
photocopying, recording, or by any information storage
and retrieval system without the written permission of
the author, except where permitted by law.
ISBN: 978-1478355823
Cover art by Abigail Doxsey Anderson.
Portions of this text are reproduced from work created
and shared by Google and used according to terms
described in the Creative Commons 3.0 Attribution
License.
Contents
1 Getting Started 1
1.1 Files and Folders 2
1.2 The Terminal 5
1.3 Text Editors 9
1.4 Go Tools 13
2 Your First Program 15
2.1 How to Read a Go Program 17
3 Types 23
3.1 Numbers 24
3.2 Strings 29
3.3 Booleans 31
4 Variables 35
4.1 How to Name a Variable 39
4.2 Scope 40
4.3 Constants 43
4.4 Defining Multiple Variables 44
4.5 An Example Program 45
5 Control Structures 47
5.1 For 48
5.2 If 51
5.3 Switch 55
6 Arrays, Slices and Maps 58
6.1 Arrays 58
6.2 Slices 64
6.3 Maps 67
7 Functions 76
7.1 Your Second Function 77
7.2 Returning Multiple Values 82
7.3 Variadic Functions 82
7.4 Closure 84
7.5 Recursion 86
7.6 Defer, Panic & Recover 88
8 Pointers 92
8.1 The * and & operators 93
8.2 new 94
9 Structs and Interfaces 97
9.1 Structs 98
9.2 Methods 101
9.3 Interfaces 104
10 Concurrency 108
10.1 Goroutines 108
10.2 Channels 111
11 Packages 120
11.1 Creating Packages 121
11.2 Documentation 124
12 Testing 127
13 The Core Packages 132
13.1 Strings 132
13.2 Input / Output 134
13.3 Files & Folders 135
13.4 Errors 140
13.5 Containers & Sort 141
13.6 Hashes & Cryptography 144
13.7 Servers 147
13.8 Parsing Command Line Arguments 155
13.9 Synchronization Primitives 156
14 Next Steps 159
14.1 Study the Masters 159
14.2 Make Something 160
14.3 Team Up 161
1 Getting Started
Computer programming is the art, craft and science of
writing programs which define how computers operate.
This book will teach you how to write computer pro-
grams using a programming language designed by
Google named Go.
Go is a general purpose programming language with
advanced features and a clean syntax. Because of its
wide availability on a variety of platforms, its robust
well-documented common library, and its focus on good
software engineering principles, Go is an ideal lan-
guage to learn as your first programming language.
The process we use to write software using Go (and
most programming languages) is fairly straightfor-
ward:
1. Gather requirements
2. Find a solution
3. Write source code to implement the solution
1
剩余164页未读,继续阅读
资源评论
concisedistinct
- 粉丝: 1305
- 资源: 153
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功