GithubHelp home page GithubHelp logo

miekg / gobook Goto Github PK

View Code? Open in Web Editor NEW
874.0 60.0 96.0 4.97 MB

A complete introduction into Go, superseded by https://github.com/miekg/learninggo

Home Page: https://miek.nl/go

Makefile 0.58% TeX 86.14% Perl 1.89% Go 11.20% Elixir 0.18%
go tex learning book free

gobook's Introduction

"Learning Go" is now available online.

See https://miek.nl/go and this github repo.

Note this book's source has been rewritten in mmark and that source is available at https://github.com/miekg/learninggo.

THIS REPO IS DEPRECATED.

Learning Go - a free PDF for learning the Go language.

The book currently consists of the following chapters:

  1. Introduction: Details the lineage of the language Go and shows the types, variables and control structures.
  2. Functions: How to make and use functions.
  3. Packages: Functions and data are grouped together in packages. Here you will see how to make your own package. How to unit test your package is also described.
  4. Beyond the basics: Learn how to create your own data types and define functions on them (called methods in Go).
  5. Interfaces: Go does not support Object Orientation in the traditional sense. In Go the central concept is interfaces.
  6. Concurrency: With the go keyword functions can be started in separate routines (called goroutines). Communication with these goroutines is done via channels.
  7. Communication : How to create/read/write from and to files. And how to do networking.

Each chapter concludes with a number of exercises with answers to help you get some hands-on experience. Currently there are more than 30 exercises.

Building the book

Package Prerequisites

When building this book from LaTeX sources files you will need the following packages on Ubuntu (tested on 13.04).

  • inkscape
  • gnumeric
  • ttf-droid
  • ttf-dejavu
  • ttf-sazanami-gothic (Japanese font)
  • ttf-arphic-ukai
  • texlive-fonts-recommended
  • texlive-extra-utils
  • texlive-xetex
  • texlive-latex-extra
  • texlive-latex-recommended
  • git-core
  • GNU make

Following is a shell script to automate the package prerequisites installation.

You can copy and paste the following code to your vt100 session to kickoff the chains of many packages installation.

# tested on Ubuntu 13.04
for i in inkscape \
gnumeric \
ttf-droid \
ttf-dejavu \
ttf-sazanami-gothic \
ttf-arphic-ukai \
texlive-fonts-recommended \
texlive-extra-utils \
texlive-xetex \
texlive-latex-extra \
texlive-latex-recommended \
latex-cjk-xcjk \
git-core \
make
do
sudo apt-get install $i -y
done

Checking out the Learning Go LaTeX sources.

Using http protocol.

me@ubuntu1204:~$git clone https://github.com/miekg/gobook.git
Cloning into 'gobook'...
remote: Counting objects: 4515, done.
remote: Compressing objects: 100% (1385/1385), done.
remote: Total 4515 (delta 3106), reused 4512 (delta 3104)
Receiving objects: 100% (4515/4515), 1.53 MiB | 1.17 MiB/s, done.
Resolving deltas: 100% (3106/3106), done.
me@ubuntu1204:~$

Using git protocol if you already have github account setup.

git clone [email protected]:tjyang/gobook.git

Make the Learning Go Book

make

Download the prebuilt Learning Go book

Latest prebuilt pdf book [can be downloaded from http://www.miek.nl/downloads/Go/] 1

gobook's People

Contributors

adamjgray avatar basdirks avatar dgryski avatar djotto avatar donthorp avatar hujinpu avatar jcs avatar jvshahid avatar lupino3 avatar mem avatar miekg avatar mikespook avatar nikai3d avatar pqpace avatar sandesh247 avatar shalakhin avatar tjyang avatar tonymagro 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  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

gobook's Issues

Converted Kindle tex is overlapping

The first line on each content page is overriding the heading. I tried to fix this but I do not know Latex.
And Kindle is arranged in portrait by default.

Answer for Chapter 1 Q4-3

Exercise: "Extend the program from the previous question to replace the three runes at po- sition 4 with โ€™abcโ€™."

How about this:

package main

import "fmt"

func main() {
  s := "asSASA ddd dsjkdsjs dk";

  // convert to array of runes
  chars := []rune(s)

  // allocate space for the head
  head := make([]rune, 3)

  // grab the head and store
  copy(head, chars[0:3]);

  // generate our new substring
  middle := []rune("abc");

  // make a new head: which is original head plus our new substring
  head = append(head, middle...);

  // grab the rest of the string
  tail := chars[4:]

  // combine our new head with the rest of the string
  combined := append(head, tail...);

  fmt.Printf("Initial: %s\n", s);
  fmt.Printf("Final: %s\n", string(combined))
}

About Leaning Go PDF deployment

Thanks for your Learning Go book ๐Ÿ‘

To make it easy to find the lastest version, it would be better to create symbolic link to 20130612-go.pdf.

$ ln -s 20130612-go.pdf learning-go-lastest.pdf

What do you think about?

Godoc v. go doc in Go 1.14

I am a novice at Go, so this might have an obvious reason/solution, however I have run into a problem on the first page of the book. It says to use godoc hash to read about the hash package. I tried that and it says this:

Unexpected arguments. Use "go doc" for command-line help output instead. For example, "go doc fmt.Printf".
usage: godoc -http=localhost:6060

When using go doc hash, everything works as expected. Should go doc hash be the recommended command to run instead?

I am not sure why the difference in Godoc and go doc. I installed godoc using go get golang.org/x/tools/cmd/godoc which is a command I just got somewhere, I didn't find any "official" way to do it and the highest ranked Google result (some reddit post) contained a command which didn't work for me (it hung). So I settled at this command.

I am using Go 1.14 so it's possible things have changed between when this (and others books and resources I've been using) were written and today.

"Object Orientation in the traditional sense"

This struck me as weird. Object orientation does not require inheritance. Go has objects which interact over clearly defined interfaces and hence is object oriented. I feel like saying it's not really object-oriented gives the wrong message and throws a bad light on an actually very nice language design.

The lack of inheritance is a "feature" i regularly point out to people new to go - as a good thing.

Is this BOOK really maintained?

First of all I'm seeing Learning as we Go 1.0
Secondly, Miek Gieben โ€“ ยฉ2010 - 2012

2012? I'm finding it hard to believe that the pre-built PDF is legit/current... since I can't really build it myself (special reasons)

SORRY, didn't see the other ONLINE version

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.