The controller imports mesh-host/validate through a replace onto the forge that holds it, and every build — the build agent's go build in a fresh toolchain container, the Dockerfile's go mod download — would have fetched it through the public proxy and checksum database at build time: a merge breaking main on the network, the class Phase 1 removes. vendor/ is committed; go builds from it with nothing fetched, and refuses to build when it and go.mod disagree, so a pin moved without go mod vendor fails at once. The Dockerfile copies vendor/ and builds with GOPROXY=off.
33 lines
785 B
Go
33 lines
785 B
Go
package pgio
|
|
|
|
func AppendUint16(buf []byte, n uint16) []byte {
|
|
return append(buf, byte(n>>8), byte(n))
|
|
}
|
|
|
|
func AppendUint32(buf []byte, n uint32) []byte {
|
|
return append(buf, byte(n>>24), byte(n>>16), byte(n>>8), byte(n))
|
|
}
|
|
|
|
func AppendUint64(buf []byte, n uint64) []byte {
|
|
return append(buf,
|
|
byte(n>>56), byte(n>>48), byte(n>>40), byte(n>>32),
|
|
byte(n>>24), byte(n>>16), byte(n>>8), byte(n),
|
|
)
|
|
}
|
|
|
|
func AppendInt16(buf []byte, n int16) []byte {
|
|
return AppendUint16(buf, uint16(n))
|
|
}
|
|
|
|
func AppendInt32(buf []byte, n int32) []byte {
|
|
return AppendUint32(buf, uint32(n))
|
|
}
|
|
|
|
func AppendInt64(buf []byte, n int64) []byte {
|
|
return AppendUint64(buf, uint64(n))
|
|
}
|
|
|
|
func SetInt32(buf []byte, n int32) {
|
|
*(*[4]byte)(buf) = [4]byte{byte(n >> 24), byte(n >> 16), byte(n >> 8), byte(n)}
|
|
}
|