Style: format code by gofumpt (#761)

This commit is contained in:
yuhan6665 2021-10-19 12:57:14 -04:00 committed by GitHub
parent d77be80b40
commit e286cdcaa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
111 changed files with 293 additions and 291 deletions

View file

@ -290,7 +290,6 @@ func (w *AuthenticationWriter) writeStream(mb buf.MultiBuffer) error {
mb = nb
eb, err := w.seal(rawBytes[:nBytes])
if err != nil {
buf.ReleaseMulti(mb2Write)
return err

View file

@ -18,7 +18,7 @@ func mustDecodeHex(s string) []byte {
}
func TestChaCha20Stream(t *testing.T) {
var cases = []struct {
cases := []struct {
key []byte
iv []byte
output []byte

View file

@ -3,7 +3,7 @@ package internal
import "encoding/binary"
func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
var x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15 = s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13], s[14], s[15]
x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15 := s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8], s[9], s[10], s[11], s[12], s[13], s[14], s[15]
for i := 0; i < rounds; i += 2 {
var x uint32

View file

@ -56,7 +56,7 @@ func ChaCha20Block(s *[16]uint32, out []byte, rounds int) {
}
func main() {
file, err := os.OpenFile("chacha_core.generated.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0644)
file, err := os.OpenFile("chacha_core.generated.go", os.O_WRONLY|os.O_TRUNC|os.O_CREATE, 0o644)
if err != nil {
log.Fatalf("Failed to generate chacha_core.go: %v", err)
}

View file

@ -27,9 +27,7 @@ func (r *CryptionReader) Read(data []byte) (int, error) {
return nBytes, err
}
var (
_ buf.Writer = (*CryptionWriter)(nil)
)
var _ buf.Writer = (*CryptionWriter)(nil)
type CryptionWriter struct {
stream cipher.Stream