# opt
`opt` is a tiny package that reduces boilerplate for functional options.
Simply decide whether your options can return errors or not, then use the corresponding type.
Without errors:
```go
typeFoostruct{Barstring}funcWithBar(bstring)opt.Func[Foo]{returnfunc(f*Foo){f.Bar=b}}```With errors:
```go
typeFoostruct{Barstring}funcWithBar(bstring)opt.ErrorFunc[Foo]{returnfunc(f*Foo)error{f.Bar=breturnnil}}```## License
[MIT](LICENSE)
Credit to `@segfaultax` in the [Discord Gophers](https://discord.gg/golang) server for the idea and starting implementation.