Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for MarshalerError (2.9 sec)

  1. src/encoding/json/encode.go

    	return "json: invalid UTF-8 in string: " + strconv.Quote(e.S)
    }
    
    // A MarshalerError represents an error from calling a
    // [Marshaler.MarshalJSON] or [encoding.TextMarshaler.MarshalText] method.
    type MarshalerError struct {
    	Type       reflect.Type
    	Err        error
    	sourceFunc string
    }
    
    func (e *MarshalerError) Error() string {
    	srcFunc := e.sourceFunc
    	if srcFunc == "" {
    		srcFunc = "MarshalJSON"
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:18:55 UTC 2024
    - 36.2K bytes
    - Viewed (0)
  2. src/encoding/json/encode_test.go

    	const errText = "json: test error"
    
    	tests := []struct {
    		CaseName
    		err  *MarshalerError
    		want string
    	}{{
    		Name(""),
    		&MarshalerError{st, fmt.Errorf(errText), ""},
    		"json: error calling MarshalJSON for type " + st.String() + ": " + errText,
    	}, {
    		Name(""),
    		&MarshalerError{st, fmt.Errorf(errText), "TestMarshalerError"},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 18:42:28 UTC 2024
    - 29.4K bytes
    - Viewed (0)
Back to top