github.com/thetreep/go-swagger@v0.0.0-20240223100711-35af64f14f01/fixtures/bugs/1719/pkg/models/user.go (about) 1 // Code generated by go-swagger; DO NOT EDIT. 2 3 package models 4 5 // This file was generated by the swagger tool. 6 // Editing this file might prove futile when you re-run the swagger generate command 7 8 import ( 9 strfmt "github.com/go-openapi/strfmt" 10 11 "context" 12 13 "github.com/go-openapi/swag" 14 ) 15 16 // ExtUser user 17 // swagger:model ExtUser 18 type ExtUser struct { 19 20 // age 21 Age int64 `json:"age,omitempty"` 22 23 // name 24 Name string `json:"name,omitempty"` 25 } 26 27 // Validate validates this user 28 func (m *ExtUser) Validate(formats strfmt.Registry) error { 29 return nil 30 } 31 32 // ContextValidate validate this user based on context it is used 33 func (m *ExtUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error { 34 return nil 35 } 36 37 // MarshalBinary interface implementation 38 func (m *ExtUser) MarshalBinary() ([]byte, error) { 39 if m == nil { 40 return nil, nil 41 } 42 return swag.WriteJSON(m) 43 } 44 45 // UnmarshalBinary interface implementation 46 func (m *ExtUser) UnmarshalBinary(b []byte) error { 47 var res ExtUser 48 if err := swag.ReadJSON(b, &res); err != nil { 49 return err 50 } 51 *m = res 52 return nil 53 }