String implements the [fmt.Stringer] interface.
()
| 57 | |
| 58 | // String implements the [fmt.Stringer] interface. |
| 59 | func (o Option[T]) String() string { |
| 60 | if o.present { |
| 61 | return fmt.Sprintf("Some(%v)", o.value) |
| 62 | } |
| 63 | |
| 64 | return "None" |
| 65 | } |
| 66 | |
| 67 | var _ fmt.Stringer = Option[struct{}]{} |
| 68 |
nothing calls this directly
no outgoing calls
no test coverage detected