package gojayconst hex = "0123456789abcdef"// grow grows b's capacity, if necessary, to guarantee space for// another n bytes. After grow(n), at least n bytes can be written to b// without another allocation. If n is negative, grow panics.func ( *Encoder) ( int) {ifcap(.buf)-len(.buf) < { := make([]byte, len(.buf), 2*cap(.buf)+)copy(, .buf) .buf = }}// Write appends the contents of p to b's Buffer.// Write always returns len(p), nil.func ( *Encoder) ( []byte) { .buf = append(.buf, ...)}func ( *Encoder) ( byte, byte) { .buf = append(.buf, , )}// WriteByte appends the byte c to b's Buffer.// The returned error is always nil.func ( *Encoder) ( byte) { .buf = append(.buf, )}// WriteString appends the contents of s to b's Buffer.// It returns the length of s and a nil error.func ( *Encoder) ( string) { .buf = append(.buf, ...)}func ( *Encoder) ( string) { := len()for := 0; < ; ++ { := []if >= 0x20 && != '\\' && != '"' { .writeByte()continue }switch {case'\\', '"': .writeTwoBytes('\\', )case'\n': .writeTwoBytes('\\', 'n')case'\f': .writeTwoBytes('\\', 'f')case'\b': .writeTwoBytes('\\', 'b')case'\r': .writeTwoBytes('\\', 'r')case'\t': .writeTwoBytes('\\', 't')default: .writeString(`\u00`) .writeTwoBytes(hex[>>4], hex[&0xF]) }continue }}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.