Example #1
0
File: main.go Project: tslnc04/go-1
func list() {
	users := s.GetUserNames()
	for _, user := range users {
		n, _ := bux.Get(user)
		fmt.Printf("%20s %v\n", user, n)
	}
}
Example #2
0
File: bux.go Project: 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
}