Skip to content

Instantly share code, notes, and snippets.

View inoyatov's full-sized avatar
🤖
Working in automatic mood

Inoyatov Khamidulla inoyatov

🤖
Working in automatic mood
View GitHub Profile
type Animal interface {
Name() string
}
type Doc struct{}
func (doc Dog) Name() string {
return "AuAu"
}
@inoyatov
inoyatov / listing_07_01.go
Created October 10, 2016 08:46
Concurrency patterns
// Listing 7.1 runner/runner.go
// Example is provided with help by Gabriel Aszalos.
// Package runner manages the running and lifetime of a process.
package runner
import (
"errors"
"os"
"os/signal"
"time"
@inoyatov
inoyatov / listing_06_01.go
Created October 10, 2016 07:59
Concurrency
// Listing 6.1 listing01.go
// This sample program demonstrates how to create goroutines and
// how the scheduler behaves.
package main
import (
"fmt"
"runtime"
"sync"
)
@inoyatov
inoyatov / listing_05_01.go
Created October 10, 2016 06:40
Go's type system
// Listing 5.1 Declaration of a struct type
// user defines a user in the program.
type user struct {
name string
email string
ext int
privileged bool
}
package main
import (
"log"
"os"
"os/signal"
"syscall"
"time"
)
xinput --list
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ Logitech USB Receiver id=13 [slave pointer (2)]
⎜ ↳ Logitech USB Receiver id=14 [slave pointer (2)]
⎜ ↳ HAG HHKB modified by HelgeG id=11 [slave pointer (2)]
⎜ ↳ HAG HHKB modified by HelgeG id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]