github.com/AngusLu/go-swagger@v0.28.0/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  	"github.com/go-openapi/swag"
    13  )
    14  
    15  // ExtUser user
    16  // swagger:model ExtUser
    17  type ExtUser struct {
    18  
    19  	// age
    20  	Age int64 `json:"age,omitempty"`
    21  
    22  	// name
    23  	Name string `json:"name,omitempty"`
    24  }
    25  
    26  // Validate validates this user
    27  func (m *ExtUser) Validate(formats strfmt.Registry) error {
    28  	return nil
    29  }
    30  
    31  // ContextValidate validate this user based on context it is used
    32  func (m *ExtUser) ContextValidate(ctx context.Context, formats strfmt.Registry) error {
    33  	return nil
    34  }
    35  
    36  // MarshalBinary interface implementation
    37  func (m *ExtUser) MarshalBinary() ([]byte, error) {
    38  	if m == nil {
    39  		return nil, nil
    40  	}
    41  	return swag.WriteJSON(m)
    42  }
    43  
    44  // UnmarshalBinary interface implementation
    45  func (m *ExtUser) UnmarshalBinary(b []byte) error {
    46  	var res ExtUser
    47  	if err := swag.ReadJSON(b, &res); err != nil {
    48  		return err
    49  	}
    50  	*m = res
    51  	return nil
    52  }