1 package jreader 2 3 // NewReader creates a Reader that consumes the specified JSON input data. 4 // 5 // This function returns the struct by value (Reader, not *Reader). This avoids the overhead of a 6 // heap allocation since, in typical usage, the Reader will not escape the scope in which it was 7 // declared and can remain on the stack. 8 func NewReader(data []byte) Reader { 9 return Reader{ 10 tr: newTokenReader(data), 11 } 12 } 13