packageopt// Func is a functional option for AtypeFunc[Aany]func(*A)// Apply applies all options to AfuncApply[Aany](a*A,opts...Func[A]){for_,opt:=rangeopts{opt(a)}}// ErrorFunc is a functional option for A that can return an errortypeErrorFunc[Aany]func(*A)error// ApplyError applies all options to A, returning the first errorfuncApplyError[Aany](a*A,opts...ErrorFunc[A])error{for_,opt:=rangeopts{iferr:=opt(a);err!=nil{returnerr}}returnnil}