Програмиране с Go

01.10.2013

Здравейте

Нека ви обясним къде сте попаднали.

Експериментален курс

Лекции

You asked me once, what was in Room 101. I told you that you knew the answer already. Everyone knows it. The thing that is in Room 101 is the worst thing in the world

1984, George Orwell

В интернеда

Торонто

Там пием бира след всяка лекция.

Походи

Почти всеки уикенд (при адекватни климатични условия) ще ходим из разни гористи местности и ще се радваме, ако идвате с нас.

(Да, можем да поемем 100 души с нас)

Когато времето е кофти, ще пием бира някъде.

Оценяване

Ще събирате точки

Домашни

Тестове

Проект

Но поне сме щедри с точките

Участие по време на лекция

Участие в сайта

Помощ с материалите

Предизвикателства

Защо всичко трябва да бъде толкова сложно!?

Go

Малко история

Малко история

C for the 21st century

"Трите свята"

Резултатът

Стандартната библиотека

archive tar zip bufio builtin bytes compress bzip2 flate gzip lzw
zlib container heap list ring crypto aes cipher des dsa ecdsa
elliptic hmac md5 rand rc4 rsa sha1 sha256 sha512 subtle tls
x509 pkix database sql driver debug dwarf elf gosym macho pe
encoding ascii85 asn1 base32 base64 binary csv gob hex json
pem xml errors expvar flag fmt go ast build doc format parser
printer scanner token hash adler32 crc32 crc64 fnv html
template image color draw gif jpeg png index suffixarray io
ioutil log syslog math big cmplx rand mime multipart net http
cgi cookiejar fcgi httptest httputil pprof mail rpc jsonrpc smtp
textproto url os exec signal user path filepath reflect regexp
syntax runtime cgo debug pprof race sort strconv strings sync
atomic syscall testing iotest quick text scanner tabwriter
template parse time unicode utf16 utf8 unsafe

Научените уроци

Малко код

package workq

type Queue []*Item

func (q *Queue) Push(item *Item) {
    *q = append(*q, item)
    go item.Translate()
}

func (q *Queue) Pop() *Item {
    if !q.IsEmpty() {
        old := *q
        item := old[0]
        <- item.Done
        *q = old[1:len(old)]
        return item
    }
    return nil
}

func (q *Queue) Len() int {
    return len(*q)
}

Въпроси?