Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for MarshalJSON (0.14 sec)

  1. logger/sql_test.go

    	"github.com/jinzhu/now"
    	"gorm.io/gorm/logger"
    )
    
    type JSON json.RawMessage
    
    func (j JSON) Value() (driver.Value, error) {
    	if len(j) == 0 {
    		return nil, nil
    	}
    	return json.RawMessage(j).MarshalJSON()
    }
    
    type ExampleStruct struct {
    	Name string
    	Val  string
    }
    
    func (s ExampleStruct) Value() (driver.Value, error) {
    	return json.Marshal(s)
    }
    
    func format(v []byte, escaper string) string {
    Go
    - Registered: Sun May 05 09:35:13 GMT 2024
    - Last Modified: Thu Mar 21 08:00:02 GMT 2024
    - 8.4K bytes
    - Viewed (0)
Back to top