mirror of
https://github.com/golang/go.git
synced 2025-05-05 15:43:04 +00:00
encoding/base64: use internal/byteorder
This permits us to remove the dependency on reflect. Change-Id: I60b1e9fd713f340bfd5eec2edfa58fc724a8e2d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/641936 Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Robert Griesemer <gri@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Bypass: Ian Lance Taylor <iant@golang.org> Auto-Submit: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
5c9b13d90f
commit
7c6b047ea1
@ -6,7 +6,7 @@
|
||||
package base64
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"internal/byteorder"
|
||||
"io"
|
||||
"slices"
|
||||
"strconv"
|
||||
@ -538,7 +538,7 @@ func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
|
||||
enc.decodeMap[src2[6]],
|
||||
enc.decodeMap[src2[7]],
|
||||
); ok {
|
||||
binary.BigEndian.PutUint64(dst[n:], dn)
|
||||
byteorder.BEPutUint64(dst[n:], dn)
|
||||
n += 6
|
||||
si += 8
|
||||
} else {
|
||||
@ -559,7 +559,7 @@ func (enc *Encoding) Decode(dst, src []byte) (n int, err error) {
|
||||
enc.decodeMap[src2[2]],
|
||||
enc.decodeMap[src2[3]],
|
||||
); ok {
|
||||
binary.BigEndian.PutUint32(dst[n:], dn)
|
||||
byteorder.BEPutUint32(dst[n:], dn)
|
||||
n += 3
|
||||
si += 4
|
||||
} else {
|
||||
|
@ -244,17 +244,17 @@ var depsRules = `
|
||||
# encodings
|
||||
# core ones do not use fmt.
|
||||
io, strconv, slices
|
||||
< encoding;
|
||||
< encoding, encoding/base32, encoding/base64;
|
||||
|
||||
encoding, reflect
|
||||
< encoding/binary
|
||||
< encoding/base32, encoding/base64;
|
||||
< encoding/binary;
|
||||
|
||||
FMT, encoding < flag;
|
||||
|
||||
fmt !< encoding/base32, encoding/base64;
|
||||
|
||||
FMT, encoding/base32, encoding/base64, internal/saferio
|
||||
FMT, encoding, encoding/base32, encoding/base64, encoding/binary,
|
||||
internal/saferio
|
||||
< encoding/ascii85, encoding/csv, encoding/gob, encoding/hex,
|
||||
encoding/json, encoding/pem, encoding/xml, mime;
|
||||
|
||||
@ -662,7 +662,8 @@ var depsRules = `
|
||||
log/slog, testing
|
||||
< testing/slogtest;
|
||||
|
||||
FMT, crypto/sha256, encoding/json, go/ast, go/parser, go/token,
|
||||
FMT, crypto/sha256, encoding/binary, encoding/json,
|
||||
go/ast, go/parser, go/token,
|
||||
internal/godebug, math/rand, encoding/hex
|
||||
< internal/fuzz;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user