Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
always learning

Elton Minetto eminetto

:octocat:
always learning
View GitHub Profile
View ex11.go
package chess
import "bytes"
type piece struct {
representation string
}
type location struct {
current *piece
View ex10.go
package chess
type piece struct {
representation string
}
type location struct {
current *piece
}
View ex9.go
package contact
import (
"strings"
"fmt"
)
type friends struct {
data []string
}
View ex8.go
package contact
import "fmt"
type person struct {
name string
friends []string
}
type friend struct {
View ex7.go
package ecommerce
import (
"strconv"
)
type order struct {
pid productID
cid customerID
}
View ex6.go
package ecommerce
import (
"strconv"
)
type order struct {
pid productID
cid customerID
}
View ex5.go
package ecommerce
type order struct {
pid int64
cid int64
}
func CreateOrder(pid int64, cid int64) order {
return order{
pid: pid, cid: cid,
View ex4.go
func (l *loginService) Login(userName, password string) {
if l.userRepository.IsValid(userName, password) {
redirect("homepage")
return
}
addFlash("error", "Bad credentials")
redirect("login")
}
View ex3.go
package login
import (
"github.com/user/project/user/repository"
)
type loginService struct {
userRepository *repository.UserRepository
}
View ex2.go
package chess
import "bytes"
type board struct {
data [][]string
}
func NewBoard(data [][]string) *board {
return &board{data: data}