Kodewick
Start learning →
Starter←→0 / 70

Lift limit

#056StarterErrorsConditions3 min

This lift takes at most 8 people. Write Board(people) to return nil if there's room, or the starter's ready-made error ErrTooMany if there are more than 8.

Examples
Board(5)→None
Board(10)→'too many people'
The functionfunc Board(people int) error
main.go
package main

import "errors"

var ErrTooMany = errors.New("too many people")

func Board(people int) error {
	// your code here: more than 8 people? return ErrTooMany
	return nil
}
Ctrl + Enter runs too
Result

Run tries the examples. When they look right, Submit.