mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
Refactor some file edit related code (#34744)
Follow up #34350 --------- Co-authored-by: delvh <dev.lh@web.de>
This commit is contained in:
@ -5,6 +5,12 @@ package optional
|
||||
|
||||
import "strconv"
|
||||
|
||||
// Option is a generic type that can hold a value of type T or be empty (None).
|
||||
//
|
||||
// It must use the slice type to work with "chi" form values binding:
|
||||
// * non-existing value are represented as an empty slice (None)
|
||||
// * existing value is represented as a slice with one element (Some)
|
||||
// * multiple values are represented as a slice with multiple elements (Some), the Value is the first element (not well-defined in this case)
|
||||
type Option[T any] []T
|
||||
|
||||
func None[T any]() Option[T] {
|
||||
|
Reference in New Issue
Block a user