Exemplo n.º 1
0
Arquivo: main.go Projeto: tslnc04/go-1
func list() {
	users := s.GetUserNames()
	for _, user := range users {
		n, _ := bux.Get(user)
		fmt.Printf("%20s %v\n", user, n)
	}
}
Exemplo n.º 2
0
Arquivo: bux.go Projeto: tslnc04/go-1
// Return the total of all user SkilBux in the system (minus admin account)
func GetAll() (int, error) {
	students := s.GetUserNames()
	total := 0
	for _, student := range students {
		if student != "admin" {
			n, err := read(student)
			if err != nil {
				return 0, err
			}
			total += n
		}
	}

	return total, nil
}