Skip to content

Commit 5b6a9dc

Browse files
web3-botrvagg
authored andcommitted
run gofmt -s
1 parent 890f55d commit 5b6a9dc

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

_rsrch/cidiface/cid.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type Cid interface {
3939
// and the Multihash length. It does not contains
4040
// any actual content information.
4141
// NOTE: The use -1 in MhLength to mean default length is deprecated,
42-
// use the V0Builder or V1Builder structures instead
42+
//
43+
// use the V0Builder or V1Builder structures instead
4344
type Prefix struct {
4445
Version uint64
4546
Codec uint64

_rsrch/cidiface/cidBoxingBench_test.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ import (
1212
//
1313
// Sample results on linux amd64 go1.11beta:
1414
//
15-
// BenchmarkCidMap_CidStr-8 100000 16317 ns/op
16-
// BenchmarkCidMap_CidIface-8 100000 20516 ns/op
15+
// BenchmarkCidMap_CidStr-8 100000 16317 ns/op
16+
// BenchmarkCidMap_CidIface-8 100000 20516 ns/op
1717
//
1818
// With benchmem on:
1919
//
20-
// BenchmarkCidMap_CidStr-8 100000 15579 ns/op 11223 B/op 207 allocs/op
21-
// BenchmarkCidMap_CidIface-8 100000 19500 ns/op 12824 B/op 307 allocs/op
22-
// BenchmarkCidMap_StrPlusHax-8 200000 10451 ns/op 7589 B/op 202 allocs/op
20+
// BenchmarkCidMap_CidStr-8 100000 15579 ns/op 11223 B/op 207 allocs/op
21+
// BenchmarkCidMap_CidIface-8 100000 19500 ns/op 12824 B/op 307 allocs/op
22+
// BenchmarkCidMap_StrPlusHax-8 200000 10451 ns/op 7589 B/op 202 allocs/op
2323
//
2424
// We can see here that the impact of interface boxing is significant:
2525
// it increases the time taken to do the inserts to 133%, largely because
@@ -36,7 +36,6 @@ import (
3636
// re-arranges itself, it involves more or less an O(n) copy of the content
3737
// in addition to the alloc itself). This isn't topical to the question of
3838
// whether or not interfaces are a good idea; just for contextualizing.
39-
//
4039
func BenchmarkCidMap_CidStr(b *testing.B) {
4140
for i := 0; i < b.N; i++ {
4241
mp := map[CidStr]int{}

_rsrch/cidiface/cidString.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ func NewCidStr(version uint64, codecType uint64, mhash mh.Multihash) CidStr {
114114
//
115115
// For CidV1, the data buffer is in the form:
116116
//
117-
// <version><codec-type><multihash>
117+
// <version><codec-type><multihash>
118118
//
119119
// CidV0 are also supported. In particular, data buffers starting
120120
// with length 34 bytes, which starts with bytes [18,32...] are considered

_rsrch/cidiface/cidStruct.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func (c CidStruct) Prefix() Prefix {
110110
//
111111
// For CidV1, the data buffer is in the form:
112112
//
113-
// <version><codec-type><multihash>
113+
// <version><codec-type><multihash>
114114
//
115115
// CidV0 are also supported. In particular, data buffers starting
116116
// with length 34 bytes, which starts with bytes [18,32...] are considered

cid.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//
1111
// A CIDv1 has four parts:
1212
//
13-
// <cidv1> ::= <multibase-prefix><cid-version><multicodec-packed-content-type><multihash-content-address>
13+
// <cidv1> ::= <multibase-prefix><cid-version><multicodec-packed-content-type><multihash-content-address>
1414
//
1515
// As shown above, the CID implementation relies heavily on Multiformats,
1616
// particularly Multibase
@@ -193,7 +193,7 @@ func MustParse(v interface{}) Cid {
193193
// Decode parses a Cid-encoded string and returns a Cid object.
194194
// For CidV1, a Cid-encoded string is primarily a multibase string:
195195
//
196-
// <multibase-type-code><base-encoded-string>
196+
// <multibase-type-code><base-encoded-string>
197197
//
198198
// The base-encoded string represents a:
199199
//
@@ -249,7 +249,7 @@ func ExtractEncoding(v string) (mbase.Encoding, error) {
249249
// Cast takes a Cid data slice, parses it and returns a Cid.
250250
// For CidV1, the data buffer is in the form:
251251
//
252-
// <version><codec-type><multihash>
252+
// <version><codec-type><multihash>
253253
//
254254
// CidV0 are also supported. In particular, data buffers starting
255255
// with length 34 bytes, which starts with bytes [18,32...] are considered
@@ -465,7 +465,7 @@ func (c *Cid) UnmarshalJSON(b []byte) error {
465465

466466
// MarshalJSON procudes a JSON representation of a Cid, which looks as follows:
467467
//
468-
// { "/": "<cid-string>" }
468+
// { "/": "<cid-string>" }
469469
//
470470
// Note that this formatting comes from the IPLD specification
471471
// (https://github.com/ipld/specs/tree/master/ipld)
@@ -522,7 +522,8 @@ func (c Cid) Prefix() Prefix {
522522
// and the Multihash length. It does not contains
523523
// any actual content information.
524524
// NOTE: The use -1 in MhLength to mean default length is deprecated,
525-
// use the V0Builder or V1Builder structures instead
525+
//
526+
// use the V0Builder or V1Builder structures instead
526527
type Prefix struct {
527528
Version uint64
528529
Codec uint64
@@ -561,7 +562,7 @@ func (p Prefix) Sum(data []byte) (Cid, error) {
561562

562563
// Bytes returns a byte representation of a Prefix. It looks like:
563564
//
564-
// <version><codec><mh-type><mh-length>
565+
// <version><codec><mh-type><mh-length>
565566
func (p Prefix) Bytes() []byte {
566567
size := varint.UvarintSize(p.Version)
567568
size += varint.UvarintSize(p.Codec)

0 commit comments

Comments
 (0)