aboutsummaryrefslogtreecommitdiff
path: root/go/storage
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2013-02-10 09:44:44 -0800
committerChris Lu <chris.lu@gmail.com>2013-02-10 09:44:44 -0800
commit79d11ac951dd0e04c52a1e1bc9925f3fef3d962b (patch)
tree97c8b6c3835d173ad0e003a0c2b4f588188b29c4 /go/storage
parentd4e5a22e5312ce2d0a2a8e25d45d27971b147252 (diff)
downloadseaweedfs-79d11ac951dd0e04c52a1e1bc9925f3fef3d962b.tar.xz
seaweedfs-79d11ac951dd0e04c52a1e1bc9925f3fef3d962b.zip
go vet
Diffstat (limited to 'go/storage')
-rw-r--r--go/storage/compact_map.go4
-rw-r--r--go/storage/needle.go20
-rw-r--r--go/storage/needle_read_write.go2
3 files changed, 13 insertions, 13 deletions
diff --git a/go/storage/compact_map.go b/go/storage/compact_map.go
index 0b33961c4..65fdf0e95 100644
--- a/go/storage/compact_map.go
+++ b/go/storage/compact_map.go
@@ -4,8 +4,8 @@ import ()
type NeedleValue struct {
Key Key
- Offset uint32 "Volume offset" //since aligned to 8 bytes, range is 4G*8=32G
- Size uint32 "Size of the data portion"
+ Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G
+ Size uint32 `comment:"Size of the data portion"`
}
const (
diff --git a/go/storage/needle.go b/go/storage/needle.go
index 2b66f5d69..12d46edff 100644
--- a/go/storage/needle.go
+++ b/go/storage/needle.go
@@ -19,20 +19,20 @@ const (
)
type Needle struct {
- Cookie uint32 "random number to mitigate brute force lookups"
- Id uint64 "needle id"
- Size uint32 "sum of DataSize,Data,NameSize,Name,MimeSize,Mime"
+ Cookie uint32 `comment:"random number to mitigate brute force lookups"`
+ Id uint64 `comment:"needle id"`
+ Size uint32 `comment:"sum of DataSize,Data,NameSize,Name,MimeSize,Mime"`
- DataSize uint32 "Data size" //version2
- Data []byte "The actual file data"
- Flags byte "boolean flags" //version2
+ DataSize uint32 `comment:"Data size"` //version2
+ Data []byte `comment:"The actual file data"`
+ Flags byte `comment:"boolean flags"` //version2
NameSize uint8 //version2
- Name []byte "maximum 256 characters" //version2
+ Name []byte `comment:"maximum 256 characters"` //version2
MimeSize uint8 //version2
- Mime []byte "maximum 256 characters" //version2
+ Mime []byte `comment:"maximum 256 characters"` //version2
- Checksum CRC "CRC32 to check integrity"
- Padding []byte "Aligned to 8 bytes"
+ Checksum CRC `comment:"CRC32 to check integrity"`
+ Padding []byte `comment:"Aligned to 8 bytes"`
}
func NewNeedle(r *http.Request) (n *Needle, fname string, e error) {
diff --git a/go/storage/needle_read_write.go b/go/storage/needle_read_write.go
index 0777fd106..881db50a6 100644
--- a/go/storage/needle_read_write.go
+++ b/go/storage/needle_read_write.go
@@ -24,7 +24,7 @@ func (n *Needle) Append(w io.Writer, version Version) (size uint32, err error) {
defer func(s io.Seeker, off int64) {
if err != nil {
if _, e = s.Seek(off, 0); e != nil {
- fmt.Printf("Failed to seek back to %d with error: %s\n", w, off, e)
+ fmt.Printf("Failed to seek %s back to %d with error: %s\n", w, off, e)
}
}
}(s, end)