Source File
url.go
Belonging Package
gorm.io/datatypes
package datatypesimport ()type URL url.URLfunc ( URL) () (driver.Value, error) {return .String(), nil}func ( *URL) ( interface{}) error {var stringswitch v := .(type) {case []byte:= string()case string:=default:return errors.New(fmt.Sprint("Failed to parse URL:", ))}, := url.Parse()if != nil {return}* = URL(*)return nil}func (URL) () string {return "url"}func (URL) ( *gorm.DB, *schema.Field) string {return "TEXT"}func ( *URL) () string {return (*url.URL)().String()}func ( URL) () ([]byte, error) {return json.Marshal(.String())}func ( *URL) ( []byte) error {// ignore nullif string() == "null" {return nil}, := url.Parse(strings.Trim(string(), `"'`))if != nil {return}* = URL(*)return nil}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |