Skip to content

Commit

Permalink
all: go fmt ./...
Browse files Browse the repository at this point in the history
Make all our package sources use Go 1.17 gofmt format
(adding //go:build lines).

Not strictly necessary but will avoid spurious changes
as files are edited.

Part of //go:build change (#41184).
See https://golang.org/design/draft-gobuild

Change-Id: I70526bf588bf4078887e567795867ece785d666b
Reviewed-on: https://go-review.googlesource.com/c/crypto/+/294415
Trust: Russ Cox <[email protected]>
Run-TryBot: Russ Cox <[email protected]>
TryBot-Result: Go Bot <[email protected]>
Reviewed-by: Jason A. Donenfeld <[email protected]>
Reviewed-by: Ian Lance Taylor <[email protected]>
  • Loading branch information
rsc committed Feb 20, 2021
1 parent b8e89b7 commit 5ea612d
Show file tree
Hide file tree
Showing 53 changed files with 54 additions and 1 deletion.
1 change: 1 addition & 0 deletions acme/version_go112.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.12
// +build go1.12

package acme
Expand Down
1 change: 1 addition & 0 deletions argon2/blamka_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && gc && !purego
// +build amd64,gc,!purego

package argon2
Expand Down
1 change: 1 addition & 0 deletions argon2/blamka_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !amd64 || purego || !gc
// +build !amd64 purego !gc

package argon2
Expand Down
1 change: 1 addition & 0 deletions blake2b/blake2bAVX2_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.7 && amd64 && gc && !purego
// +build go1.7,amd64,gc,!purego

package blake2b
Expand Down
1 change: 1 addition & 0 deletions blake2b/blake2b_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.7 && amd64 && gc && !purego
// +build !go1.7,amd64,gc,!purego

package blake2b
Expand Down
1 change: 1 addition & 0 deletions blake2b/blake2b_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !amd64 || purego || !gc
// +build !amd64 purego !gc

package blake2b
Expand Down
1 change: 1 addition & 0 deletions blake2b/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.9
// +build go1.9

package blake2b
Expand Down
1 change: 1 addition & 0 deletions blake2s/blake2s_386.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build 386 && gc && !purego
// +build 386,gc,!purego

package blake2s
Expand Down
1 change: 1 addition & 0 deletions blake2s/blake2s_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && gc && !purego
// +build amd64,gc,!purego

package blake2s
Expand Down
1 change: 1 addition & 0 deletions blake2s/blake2s_ref.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (!amd64 && !386) || !gc || purego
// +build !amd64,!386 !gc purego

package blake2s
Expand Down
1 change: 1 addition & 0 deletions blake2s/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.9
// +build go1.9

package blake2s
Expand Down
1 change: 1 addition & 0 deletions chacha20/chacha_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.11 && gc && !purego
// +build go1.11,gc,!purego

package chacha20
Expand Down
1 change: 1 addition & 0 deletions chacha20/chacha_noasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (!arm64 && !s390x && !ppc64le) || (arm64 && !go1.11) || !gc || purego
// +build !arm64,!s390x,!ppc64le arm64,!go1.11 !gc purego

package chacha20
Expand Down
1 change: 1 addition & 0 deletions chacha20/chacha_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package chacha20
Expand Down
1 change: 1 addition & 0 deletions chacha20/chacha_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package chacha20
Expand Down
1 change: 1 addition & 0 deletions chacha20poly1305/chacha20poly1305_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package chacha20poly1305
Expand Down
1 change: 1 addition & 0 deletions chacha20poly1305/chacha20poly1305_noasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !amd64 || !gc || purego
// +build !amd64 !gc purego

package chacha20poly1305
Expand Down
1 change: 1 addition & 0 deletions curve25519/curve25519_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && gc && !purego
// +build amd64,gc,!purego

package curve25519
Expand Down
1 change: 1 addition & 0 deletions curve25519/curve25519_noasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !amd64 || !gc || purego
// +build !amd64 !gc purego

package curve25519
Expand Down
1 change: 1 addition & 0 deletions ed25519/ed25519.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
// In Go 1.13, the ed25519 package was promoted to the standard library as
// crypto/ed25519, and this package became a wrapper for the standard library one.
//
//go:build !go1.13
// +build !go1.13

// Package ed25519 implements the Ed25519 signature algorithm. See
Expand Down
1 change: 1 addition & 0 deletions ed25519/ed25519_go113.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.13
// +build go1.13

// Package ed25519 implements the Ed25519 signature algorithm. See
Expand Down
1 change: 1 addition & 0 deletions ed25519/go113_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.13
// +build go1.13

package ed25519_test
Expand Down
1 change: 1 addition & 0 deletions internal/subtle/aliasing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !purego
// +build !purego

// Package subtle implements functions that are often useful in cryptographic
Expand Down
1 change: 1 addition & 0 deletions internal/subtle/aliasing_purego.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build purego
// +build purego

// Package subtle implements functions that are often useful in cryptographic
Expand Down
1 change: 1 addition & 0 deletions internal/wycheproof/ecdsa_compat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.15
// +build !go1.15

// ecdsa.VerifyASN1 was added in Go 1.15.
Expand Down
1 change: 1 addition & 0 deletions internal/wycheproof/ecdsa_go115_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.15
// +build go1.15

package wycheproof
Expand Down
1 change: 1 addition & 0 deletions internal/wycheproof/eddsa_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.13
// +build go1.13

package wycheproof
Expand Down
1 change: 1 addition & 0 deletions ocsp/ocsp_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.7
// +build go1.7

package ocsp
Expand Down
1 change: 1 addition & 0 deletions poly1305/bits_compat.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !go1.13
// +build !go1.13

package poly1305
Expand Down
1 change: 1 addition & 0 deletions poly1305/bits_go1.13.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.13
// +build go1.13

package poly1305
Expand Down
1 change: 1 addition & 0 deletions poly1305/mac_noasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (!amd64 && !ppc64le && !s390x) || !gc || purego
// +build !amd64,!ppc64le,!s390x !gc purego

package poly1305
Expand Down
1 change: 1 addition & 0 deletions poly1305/sum_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package poly1305
Expand Down
1 change: 1 addition & 0 deletions poly1305/sum_ppc64le.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package poly1305
Expand Down
1 change: 1 addition & 0 deletions poly1305/sum_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package poly1305
Expand Down
1 change: 1 addition & 0 deletions salsa20/salsa/salsa20_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && !purego && gc
// +build amd64,!purego,gc

package salsa
Expand Down
1 change: 1 addition & 0 deletions salsa20/salsa/salsa20_amd64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && !purego && gc
// +build amd64,!purego,gc

package salsa
Expand Down
1 change: 1 addition & 0 deletions salsa20/salsa/salsa20_noasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !amd64 || purego || !gc
// +build !amd64 purego !gc

package salsa
Expand Down
1 change: 1 addition & 0 deletions sha3/hashes_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !gc || purego || !s390x
// +build !gc purego !s390x

package sha3
Expand Down
3 changes: 2 additions & 1 deletion sha3/keccakf.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// +build !amd64 purego !gc
//go:build !amd64 || purego || !gc
// +build !amd64 purego !gc

package sha3

Expand Down
1 change: 1 addition & 0 deletions sha3/keccakf_amd64.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build amd64 && !purego && gc
// +build amd64,!purego,gc

package sha3
Expand Down
1 change: 1 addition & 0 deletions sha3/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build go1.4
// +build go1.4

package sha3
Expand Down
1 change: 1 addition & 0 deletions sha3/sha3_s390x.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build gc && !purego
// +build gc,!purego

package sha3
Expand Down
1 change: 1 addition & 0 deletions sha3/shake_generic.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !gc || purego || !s390x
// +build !gc purego !s390x

package sha3
Expand Down
1 change: 1 addition & 0 deletions sha3/xor.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (!amd64 && !386 && !ppc64le) || purego
// +build !amd64,!386,!ppc64le purego

package sha3
Expand Down
1 change: 1 addition & 0 deletions sha3/xor_unaligned.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build (amd64 || 386 || ppc64le) && !purego
// +build amd64 386 ppc64le
// +build !purego

Expand Down
1 change: 1 addition & 0 deletions ssh/test/agent_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build aix darwin dragonfly freebsd linux netbsd openbsd

package test
Expand Down
1 change: 1 addition & 0 deletions ssh/test/banner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build aix darwin dragonfly freebsd linux netbsd openbsd

package test
Expand Down
1 change: 1 addition & 0 deletions ssh/test/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd
// +build aix darwin dragonfly freebsd linux netbsd openbsd

package test
Expand Down
1 change: 1 addition & 0 deletions ssh/test/dial_unix_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build !windows && !solaris && !js
// +build !windows,!solaris,!js

package test
Expand Down
Loading

0 comments on commit 5ea612d

Please sign in to comment.