Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for badMarshaler (0.08 sec)

  1. src/html/template/escape_test.go

    package template
    
    import (
    	"bytes"
    	"encoding/json"
    	"fmt"
    	"os"
    	"strings"
    	"testing"
    	"text/template"
    	"text/template/parse"
    )
    
    type badMarshaler struct{}
    
    func (x *badMarshaler) MarshalJSON() ([]byte, error) {
    	// Keys in valid JSON must be double quoted as must all strings.
    	return []byte("{ foo: 'not quite valid JSON' }"), nil
    }
    
    type goodMarshaler struct{}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Oct 16 03:29:27 UTC 2023
    - 56.2K bytes
    - Viewed (0)
Back to top