/
githubmirror
/
origin
Обзор
Документация
Войти
/
githubmirror
/
origin
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
vendor/github.com/aws/smithy-go/encoding/json/encoder.go
30 строк
594 B
Thuan Vo
mod: go mod vendor
07 апр 2026, 23:42
07 апр 2026, 23:42
8e90373
Код
Авторство
О чём код?
package json import ( "bytes" ) // Encoder is JSON encoder that supports construction of JSON values // using methods. type Encoder struct { w *bytes.Buffer Value } // NewEncoder returns a new JSON encoder func NewEncoder() *Encoder { writer := bytes.NewBuffer(nil) scratch := make([]byte, 64) return &Encoder{w: writer, Value: newValue(writer, &scratch)} } // String returns the String output of the JSON encoder func (e Encoder) String() string { return e.w.String() } // Bytes returns the []byte slice of the JSON encoder func (e Encoder) Bytes() []byte { return e.w.Bytes() }