Skip to content

Commit 4607612

Browse files
committed
all: fix formatting
Change-Id: I0e362a176919e105e3c647e248883509845a9ca1
1 parent a2a5c61 commit 4607612

File tree

18 files changed

+66
-60
lines changed

18 files changed

+66
-60
lines changed

base58/doc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
Package base58 provides an API for working with modified base58 and Base58Check
77
encodings.
88
9-
Modified Base58 Encoding
9+
# Modified Base58 Encoding
1010
1111
Standard base58 encoding is similar to standard base64 encoding except, as the
1212
name implies, it uses a 58 character alphabet which results in an alphanumeric
@@ -17,7 +17,7 @@ The modified base58 alphabet used by Bitcoin, and hence this package, omits the
1717
0, O, I, and l characters that look the same in many fonts and are therefore
1818
hard to humans to distinguish.
1919
20-
Base58Check Encoding Scheme
20+
# Base58Check Encoding Scheme
2121
2222
The Base58Check encoding scheme is primarily used for Bitcoin addresses at the
2323
time of this writing, however it can be used to generically encode arbitrary

base58/genalphabet.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// Use of this source code is governed by an ISC
33
// license that can be found in the LICENSE file.
44

5-
//+build ignore
5+
//go:build ignore
6+
// +build ignore
67

78
package main
89

currency/amount.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ func AmountFromBaseUnits(units int64, currency *Currency) Amount {
208208
//
209209
// Example:
210210
//
211-
// AmountFromDecimal(decimal.NewFromFloat(3.50), USDollars) == Amount{baseUnits: 350, currency: USDollars}
211+
// AmountFromDecimal(decimal.NewFromFloat(3.50), USDollars) == Amount{baseUnits: 350, currency: USDollars}
212212
func AmountFromDecimal(d decimal.Decimal, currency *Currency) Amount {
213213
return AmountFromBaseUnits(d.Shift(currency.decimalPlaces).Round(0).IntPart(), currency)
214214
}

encryption/store.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -16,21 +16,21 @@ import (
1616
//
1717
// For example, if the Store contains the mappings
1818
//
19-
// b1, u1/u2/u3 => <e1/e2/e3, k3>
20-
// b1, u1/u2/u3/u4 => <e1/e2/e3/e4, k4>
21-
// b1, u1/u5 => <e1/e5, k5>
22-
// b1, u6 => <e6, k6>
23-
// b1, u6/u7/u8 => <e6/e7/e8, k8>
24-
// b2, u1 => <e1', k1'>
19+
// b1, u1/u2/u3 => <e1/e2/e3, k3>
20+
// b1, u1/u2/u3/u4 => <e1/e2/e3/e4, k4>
21+
// b1, u1/u5 => <e1/e5, k5>
22+
// b1, u6 => <e6, k6>
23+
// b1, u6/u7/u8 => <e6/e7/e8, k8>
24+
// b2, u1 => <e1', k1'>
2525
//
2626
// then the following lookups have outputs:
2727
//
28-
// b1, u1 => <{e2:u2, e5:u5}, [], nil>
29-
// b1, u1/u2/u3 => <{e4:u4}, [], <u1/u2/u3, e1/e2/e3, k3>>
30-
// b1, u1/u2/u3/u6 => <{}, [u6], <u1/u2/u3, e1/e2/e3, k3>>
31-
// b1, u1/u2/u3/u4 => <{}, [], <u1/u2/u3/u4, e1/e2/e3/e4, k4>>
32-
// b1, u6/u7 => <{e8:u8}, [u7], <u6, e6, k6>>
33-
// b2, u1 => <{}, [u1], <u1, e1', k1'>>
28+
// b1, u1 => <{e2:u2, e5:u5}, [], nil>
29+
// b1, u1/u2/u3 => <{e4:u4}, [], <u1/u2/u3, e1/e2/e3, k3>>
30+
// b1, u1/u2/u3/u6 => <{}, [u6], <u1/u2/u3, e1/e2/e3, k3>>
31+
// b1, u1/u2/u3/u4 => <{}, [], <u1/u2/u3/u4, e1/e2/e3/e4, k4>>
32+
// b1, u6/u7 => <{e8:u8}, [u7], <u6, e6, k6>>
33+
// b2, u1 => <{}, [u1], <u1, e1', k1'>>
3434
type Store struct {
3535
roots map[string]*node
3636
defaultKey *storj.Key

identity/testidentity/gen_identities.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information
33

4+
//go:build ignore
45
// +build ignore
56

67
// gen_identities generates random identities table for testing

peertls/peertls.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ func CreateSelfSignedCertificate(key crypto.PrivateKey, template *x509.Certifica
141141
// CreateCertificate creates a new X.509v3 certificate based on a template.
142142
// The new certificate:
143143
//
144-
// * will have the public key given as 'signee'
145-
// * will be signed by 'signer' (which should be the private key of 'issuer')
146-
// * will be issued by 'issuer'
147-
// * will have metadata fields copied from 'template'
144+
// - will have the public key given as 'signee'
145+
// - will be signed by 'signer' (which should be the private key of 'issuer')
146+
// - will be issued by 'issuer'
147+
// - will have metadata fields copied from 'template'
148148
//
149149
// Returns the new Certificate object.
150150
func CreateCertificate(signee crypto.PublicKey, signer crypto.PrivateKey, template, issuer *x509.Certificate) (*x509.Certificate, error) {

pkcrypto/doc.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information.
33

4-
/*Package pkcrypto contains a set of helper functions and constants to perform
4+
/*
5+
Package pkcrypto contains a set of helper functions and constants to perform
56
common cryptographic operations like:
67
78
* Signing and verification
89
910
* Public and private key generation
1011
1112
* Certification generation
12-
1313
*/
1414
package pkcrypto

processgroup/kill_fallback.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information
33

4+
//go:build !windows && !linux && !darwin && !netbsd && !freebsd && !openbsd
45
// +build !windows,!linux,!darwin,!netbsd,!freebsd,!openbsd
56

67
package processgroup

processgroup/kill_windows.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information
33

4+
//go:build windows
45
// +build windows
56

67
package processgroup

socket/background.go

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ import (
2020
// This is useful for configuring storj.io/uplink.Config.DialContext
2121
// to be background sockets. Expected usage like:
2222
//
23-
// cfg := uplink.Config{
24-
// DialContext: socket.BackgroundDialer().DialContext,
25-
// }
26-
//
23+
// cfg := uplink.Config{
24+
// DialContext: socket.BackgroundDialer().DialContext,
25+
// }
2726
func BackgroundDialer() *net.Dialer {
2827
return &net.Dialer{
2928
Control: func(network, address string, c syscall.RawConn) error {

socket/background_other.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
// Copyright (C) 2020 Storj Labs, Inc.
22
// See LICENSE for copying information.
33

4-
// +build !linux
5-
// +build !darwin
6-
// +build !windows
4+
//go:build !linux && !darwin && !windows
5+
// +build !linux,!darwin,!windows
76

87
package socket
98

storj/location/country.go

-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

storj/location/doc.go

+2
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33

44
// Package location contains geolocation related constants and variables.
55
package location
6+
7+
//go:generate go run ./gen/generate.go

storj/location/gen/generate.go

-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ package location
5050
// license of the datasource: Creative Commons Attribution 4.0 License,
5151
// https://creativecommons.org/licenses/by/4.0/
5252
53-
//go:generate go run ./gen/generate.go
5453
// country codes to two letter upper case ISO country code as uint16.
5554
const (`)
5655
if err != nil {

storj/nodeurl.go

+8-8
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ type NodeURL struct {
2525
//
2626
// Examples:
2727
//
28-
// raw IP:
29-
// 33.20.0.1:7777
30-
// [2001:db8:1f70::999:de8:7648:6e8]:7777
28+
// raw IP:
29+
// 33.20.0.1:7777
30+
// [2001:db8:1f70::999:de8:7648:6e8]:7777
3131
//
32-
// with NodeID:
33-
34-
// 12vha9oTFnerxYRgeQ2BZqoFrLrnmmf5UWTCY2jA77dF3YvWew7@[2001:db8:1f70::999:de8:7648:6e8]:7777
32+
// with NodeID:
33+
34+
// 12vha9oTFnerxYRgeQ2BZqoFrLrnmmf5UWTCY2jA77dF3YvWew7@[2001:db8:1f70::999:de8:7648:6e8]:7777
3535
//
36-
// without host:
37-
// 12vha9oTFnerxYRgeQ2BZqoFrLrnmmf5UWTCY2jA77dF3YvWew7@
36+
// without host:
37+
// 12vha9oTFnerxYRgeQ2BZqoFrLrnmmf5UWTCY2jA77dF3YvWew7@
3838
func ParseNodeURL(s string) (NodeURL, error) {
3939
if s == "" {
4040
return NodeURL{}, nil

sync2/doc.go

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information
33

4-
/*Package sync2 provides a set of functions and types for:
4+
/*
5+
Package sync2 provides a set of functions and types for:
56
6-
* Having context aware functionalities which aren't present in the standard
7-
library.
8-
* For offloading memory through the file system.
9-
* To control execution of tasks which can run repetitively, concurrently or
10-
asynchronously.
7+
- Having context aware functionalities which aren't present in the standard
8+
library.
9+
- For offloading memory through the file system.
10+
- To control execution of tasks which can run repetitively, concurrently or
11+
asynchronously.
1112
*/
1213
package sync2

testcontext/compile_race.go

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Copyright (C) 2019 Storj Labs, Inc.
22
// See LICENSE for copying information.
33

4+
//go:build race
45
// +build race
56

67
package testcontext

useragent/parse.go

+17-15
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func ParseEntries(data []byte) ([]Entry, error) {
9393

9494
// parseEntry parses either a product or a comment.
9595
//
96-
// Entry = ( product / comment )
96+
// Entry = ( product / comment )
9797
func parseEntry(data []byte, from int) (e Entry, next int, err error) {
9898
// We are at the start of a character. Example valid input:
9999
// `Mozilla/5.0`
@@ -116,8 +116,8 @@ func parseEntry(data []byte, from int) (e Entry, next int, err error) {
116116

117117
// parseProduct parses product with optional version.
118118
//
119-
// product = token ["/" product-version]
120-
// product-version = token
119+
// product = token ["/" product-version]
120+
// product-version = token
121121
func parseProduct(data []byte, from int) (product, version string, next int, err error) {
122122
// Example valid input:
123123
// `Mozilla`
@@ -148,7 +148,7 @@ func parseProduct(data []byte, from int) (product, version string, next int, err
148148

149149
// parseToken parses a token.
150150
//
151-
// token = 1*tchar
151+
// token = 1*tchar
152152
func parseToken(data []byte, from int) (token string, next int, ok bool) {
153153
// token is a sequence of token characters.
154154
// See tchar for the allowed characters.
@@ -163,10 +163,10 @@ func parseToken(data []byte, from int) (token string, next int, ok bool) {
163163

164164
// parseComment parses a potentially comment. This does not allow nesting.
165165
//
166-
// comment = "(" *( ctext / quoted-pair / comment ) ")"
167-
// ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
168-
// quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
169-
// obs-text = %x80-FF
166+
// comment = "(" *( ctext / quoted-pair / comment ) ")"
167+
// ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
168+
// quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
169+
// obs-text = %x80-FF
170170
func parseComment(data []byte, from int) (comment string, next int, err error) {
171171
// `(Linux; U; Android 4.4.3;)`
172172
// `(Linux; \(; Android)`
@@ -212,9 +212,9 @@ func parseComment(data []byte, from int) (comment string, next int, err error) {
212212

213213
// parseCommentChar parses comment character.
214214
//
215-
// ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
216-
// quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
217-
// obs-text = %x80-FF
215+
// ctext = HTAB / SP / %x21-27 / %x2A-5B / %x5D-7E / obs-text
216+
// quoted-pair = "\" ( HTAB / SP / VCHAR / obs-text )
217+
// obs-text = %x80-FF
218218
func parseCommentChar(data []byte, from int) (ch byte, next int, err error) {
219219
p := from
220220
b := data[p]
@@ -271,10 +271,12 @@ func requireWhitespace(data []byte, from int) (next int, ok bool) {
271271
return next, true
272272
}
273273

274-
// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
275-
// / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
276-
// / DIGIT / ALPHA
277-
// ; any VCHAR, except delimiters
274+
// istchar checks for textual-character
275+
//
276+
// tchar = "!" / "#" / "$" / "%" / "&" / "'" / "*"
277+
// / "+" / "-" / "." / "^" / "_" / "`" / "|" / "~"
278+
// / DIGIT / ALPHA
279+
// ; any VCHAR, except delimiters
278280
func istchar(b byte) bool {
279281
// DIGIT / ALPHA
280282
if '0' <= b && b <= '9' || 'a' <= b && b <= 'z' || 'A' <= b && b <= 'Z' {

0 commit comments

Comments
 (0)