GithubHelp home page GithubHelp logo

linehk / gopl Goto Github PK

View Code? Open in Web Editor NEW
195.0 3.0 71.0 12.49 MB

gopl(The Go Programming Language) is a project that contains all the sample code and all exercise answers in the Go Programming Language.

License: MIT License

Go 97.14% C 0.22% HTML 2.64%
go gopl gopl-solutions gopl-exercises gopl-problems

gopl's Introduction

gopl

build codecov go report

English | 简体中文

gopl(The Go Programming Language) is a project that contains all the sample code and all exercise answers in the Go Programming Language.

The Go Programming Language

The Go Programming Language

ISBN: 978-0134190440

Installation

apt-get install libbz2-dev
git clone https://github.com/linehk/gopl.git

Contributing

If you feel that there is something to improve my exercise answers, please feel free to launch Pull Request.

For major changes, please open an issue first to discuss what you would like to change.

License

MIT License

Greetings

Happy Go programming, I hope you enjoy writing Go as much as I do.

gopl's People

Contributors

bbxwinner avatar dependabot[bot] avatar fossabot avatar linehk avatar zhqinux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gopl's Issues

ch2-exercise2.2 undefined: Celsius

go run main.go -weight 33如果直接运行提示

 command-line-arguments
./main.go:55:37: undefined: Celsius
./main.go:55:52: undefined: CToK
./main.go:55:57: undefined: Celsius
./main.go:63:50: too many errors

正确执行 �cd ch2/exercise2.2 && go build 构建成可执行文件后 ./exercise2.2 -weight 33

ch1-dup1运行卡住了?

  1. 创建一个文件text当前目录 输入几行内容
  2. 当前目前执行命令 cat text | go run main.go
    tip: 如果是在命令行直接运行go run main.go, 程序是走到Scan()一直等待用户的输入 不会往下走了

e1.3执行基准测试输出大量 test.paniconexit0 -test.timeout是正常的吗

这个输出的内容是正常的吗? 如果是正常的话 可以不输出这些内容只输出最后的结果吗?

操作步骤
cd gopl/ch1/exercise1.3

go test -bench=.

输出下面内容

....
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
-test.paniconexit0 -test.timeout=10m0s -test.bench=.
....

练习9.3的并发安全问题

练习9.3的并发安全问题

会不会发生并发安全问题
t1,t2是两个协程
步骤一 t1 首次访问 mi.com
执行首次查询
步骤二 t1 查询终止
done返回终止消息,删除map中对应的value,关闭通道,进行广播
步骤三 t2 此时访问访问 mi.com 读map

步骤二和步骤三可能会同时对map的同一个Key进行读写,这里是不是没有进行并发处理

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.