Browse Source

go fmt

pull/693/head
Chris Lu 7 years ago
parent
commit
7e2031b18f
  1. 10
      weed/command/filer_copy.go
  2. 2
      weed/command/mount_std.go
  3. 4
      weed/command/s3.go
  4. 2
      weed/filer2/abstract_sql/abstract_sql_store.go
  5. 4
      weed/filer2/filer_master.go
  6. 2
      weed/filesys/dir.go
  7. 2
      weed/filesys/dir_rename.go
  8. 8
      weed/filesys/dirty_page.go
  9. 2
      weed/filesys/filehandle.go
  10. 8
      weed/filesys/wfs.go
  11. 2
      weed/operation/sync_volume.go
  12. 8
      weed/s3api/s3api_bucket_handlers.go
  13. 16
      weed/s3api/s3api_handlers.go
  14. 6
      weed/s3api/s3api_object_handlers.go
  15. 2
      weed/server/filer_grpc_server.go
  16. 4
      weed/server/filer_server.go
  17. 4
      weed/server/filer_server_handlers_read.go
  18. 2
      weed/server/raft_server_handlers.go
  19. 2
      weed/server/volume_grpc_client.go
  20. 2
      weed/server/volume_server.go
  21. 2
      weed/server/volume_server_handlers_sync.go
  22. 2
      weed/storage/needle/btree_map.go
  23. 2
      weed/storage/needle/compact_map.go
  24. 2
      weed/storage/needle/compact_map_perf_test.go
  25. 2
      weed/storage/needle/compact_map_test.go
  26. 2
      weed/storage/needle/needle_value.go
  27. 2
      weed/storage/needle_map_boltdb.go
  28. 4
      weed/storage/needle_map_metric.go
  29. 6
      weed/storage/needle_map_metric_test.go
  30. 6
      weed/storage/needle_parse_multipart.go
  31. 2
      weed/storage/needle_read_write.go
  32. 2
      weed/storage/needle_test.go
  33. 2
      weed/storage/store.go
  34. 6
      weed/storage/types/needle_id_type.go
  35. 12
      weed/storage/types/needle_types.go
  36. 2
      weed/storage/volume_vacuum.go
  37. 2
      weed/storage/volume_vacuum_test.go

10
weed/command/filer_copy.go

@ -8,16 +8,16 @@ import (
"path/filepath"
"strings"
"context"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/security"
"path"
"github.com/chrislusf/seaweedfs/weed/util"
"io"
"net/http"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"path"
"strconv"
"io"
"time"
"context"
"github.com/chrislusf/seaweedfs/weed/util"
)
var (

2
weed/command/mount_std.go

@ -11,8 +11,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/filesys"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
"strings"
"strconv"
"strings"
)
func runMount(cmd *Command, args []string) bool {

4
weed/command/s3.go

@ -4,11 +4,11 @@ import (
"net/http"
"time"
"fmt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/s3api"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/gorilla/mux"
"fmt"
"github.com/chrislusf/seaweedfs/weed/s3api"
)
var (

2
weed/filer2/abstract_sql/abstract_sql_store.go

@ -77,7 +77,7 @@ func (store *AbstractSqlStore) FindEntry(fullpath filer2.FullPath) (*filer2.Entr
return entry, nil
}
func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) (error) {
func (store *AbstractSqlStore) DeleteEntry(fullpath filer2.FullPath) error {
dir, name := fullpath.DirAndName()

4
weed/filer2/filer_master.go

@ -1,12 +1,12 @@
package filer2
import (
"fmt"
"context"
"fmt"
"time"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/util"
)

2
weed/filesys/dir.go

@ -9,9 +9,9 @@ import (
"bazil.org/fuse"
"bazil.org/fuse/fs"
"github.com/chrislusf/seaweedfs/weed/filer2"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/filer2"
)
type Dir struct {

2
weed/filesys/dir_rename.go

@ -1,9 +1,9 @@
package filesys
import (
"context"
"bazil.org/fuse"
"bazil.org/fuse/fs"
"context"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"path/filepath"

8
weed/filesys/dirty_page.go

@ -1,14 +1,14 @@
package filesys
import (
"fmt"
"bytes"
"time"
"context"
"fmt"
"time"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
)
type ContinuousDirtyPages struct {

2
weed/filesys/filehandle.go

@ -9,9 +9,9 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
"net/http"
"strings"
"sync"
"net/http"
)
type FileHandle struct {

8
weed/filesys/wfs.go

@ -1,15 +1,15 @@
package filesys
import (
"bazil.org/fuse"
"bazil.org/fuse/fs"
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/karlseguin/ccache"
"sync"
"bazil.org/fuse"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/karlseguin/ccache"
"strings"
"sync"
)
type WFS struct {

2
weed/operation/sync_volume.go

@ -6,8 +6,8 @@ import (
"net/url"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
)
type SyncVolumeResponse struct {

8
weed/s3api/s3api_bucket_handlers.go

@ -1,14 +1,14 @@
package s3api
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/glog"
"time"
"context"
"fmt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/gorilla/mux"
"net/http"
"os"
"time"
)
var (

16
weed/s3api/s3api_handlers.go

@ -1,17 +1,17 @@
package s3api
import (
"net/http"
"net/url"
"fmt"
"time"
"github.com/gorilla/mux"
"bytes"
"context"
"encoding/base64"
"encoding/xml"
"fmt"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util"
"bytes"
"encoding/xml"
"encoding/base64"
"github.com/gorilla/mux"
"net/http"
"net/url"
"time"
)
type mimeType string

6
weed/s3api/s3api_object_handlers.go

@ -1,12 +1,12 @@
package s3api
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/glog"
"encoding/json"
"fmt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/gorilla/mux"
"io/ioutil"
"encoding/json"
"net/http"
)
var (

2
weed/server/filer_grpc_server.go

@ -11,8 +11,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"strconv"
"github.com/chrislusf/seaweedfs/weed/util"
"strconv"
)
func (fs *FilerServer) LookupDirectoryEntry(ctx context.Context, req *filer_pb.LookupDirectoryEntryRequest) (*filer_pb.LookupDirectoryEntryResponse, error) {

4
weed/server/filer_server.go

@ -1,7 +1,6 @@
package weed_server
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/filer2"
_ "github.com/chrislusf/seaweedfs/weed/filer2/cassandra"
_ "github.com/chrislusf/seaweedfs/weed/filer2/leveldb"
@ -9,8 +8,9 @@ import (
_ "github.com/chrislusf/seaweedfs/weed/filer2/mysql"
_ "github.com/chrislusf/seaweedfs/weed/filer2/postgres"
_ "github.com/chrislusf/seaweedfs/weed/filer2/redis"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
"net/http"
)
type FilerOption struct {

4
weed/server/filer_server_handlers_read.go

@ -10,10 +10,10 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/util"
"strconv"
"mime/multipart"
"mime"
"mime/multipart"
"path"
"strconv"
)
func (fs *FilerServer) GetOrHeadHandler(w http.ResponseWriter, r *http.Request, isGetMethod bool) {

2
weed/server/raft_server_handlers.go

@ -1,8 +1,8 @@
package weed_server
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/operation"
"net/http"
)
func (s *RaftServer) HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request)) {

2
weed/server/volume_grpc_client.go

@ -7,8 +7,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/security"
"golang.org/x/net/context"
"github.com/chrislusf/seaweedfs/weed/util"
"golang.org/x/net/context"
)
func (vs *VolumeServer) GetMaster() string {

2
weed/server/volume_server.go

@ -1,10 +1,10 @@
package weed_server
import (
"net/http"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/security"
"github.com/chrislusf/seaweedfs/weed/storage"
"net/http"
)
type VolumeServer struct {

2
weed/server/volume_server_handlers_sync.go

@ -6,8 +6,8 @@ import (
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage"
"github.com/chrislusf/seaweedfs/weed/util"
"github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
)
func (vs *VolumeServer) getVolumeSyncStatusHandler(w http.ResponseWriter, r *http.Request) {

2
weed/storage/needle/btree_map.go

@ -1,8 +1,8 @@
package needle
import (
"github.com/google/btree"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/google/btree"
)
//This map assumes mostly inserting increasing keys

2
weed/storage/needle/compact_map.go

@ -1,8 +1,8 @@
package needle
import (
"sync"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"sync"
)
type CompactSection struct {

2
weed/storage/needle/compact_map_perf_test.go

@ -6,8 +6,8 @@ import (
"testing"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/util"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
)
func TestMemoryUsage(t *testing.T) {

2
weed/storage/needle/compact_map_test.go

@ -1,8 +1,8 @@
package needle
import (
"testing"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"testing"
)
func TestIssue52(t *testing.T) {

2
weed/storage/needle/needle_value.go

@ -1,8 +1,8 @@
package needle
import (
"github.com/google/btree"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/google/btree"
)
const (

2
weed/storage/needle_map_boltdb.go

@ -6,11 +6,11 @@ import (
"github.com/boltdb/bolt"
"errors"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
"errors"
)
type BoltDbNeedleMap struct {

4
weed/storage/needle_map_metric.go

@ -2,10 +2,10 @@ package storage
import (
"fmt"
"os"
"github.com/willf/bloom"
"github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/willf/bloom"
"os"
)
type mapMetric struct {

6
weed/storage/needle_map_metric_test.go

@ -1,11 +1,11 @@
package storage
import (
"testing"
"io/ioutil"
"math/rand"
"github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"io/ioutil"
"math/rand"
"testing"
)
func TestFastLoadingNeedleMapMetrics(t *testing.T) {

6
weed/storage/needle_parse_multipart.go

@ -1,12 +1,12 @@
package storage
import (
"mime"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/operation"
"io/ioutil"
"mime"
"net/http"
"path"
"io/ioutil"
"strings"
)

2
weed/storage/needle_read_write.go

@ -6,8 +6,8 @@ import (
"io"
"os"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
)

2
weed/storage/needle_test.go

@ -1,8 +1,8 @@
package storage
import (
"testing"
"github.com/chrislusf/seaweedfs/weed/storage/types"
"testing"
)
func TestParseKeyHash(t *testing.T) {

2
weed/storage/store.go

@ -5,9 +5,9 @@ import (
"strconv"
"strings"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
)
const (

6
weed/storage/types/needle_id_type.go

@ -1,9 +1,9 @@
package types
import (
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"strconv"
"fmt"
)
type NeedleId uint64
@ -21,11 +21,11 @@ func NeedleIdToUint64(needleId NeedleId) uint64 {
return uint64(needleId)
}
func Uint64ToNeedleId(needleId uint64) (NeedleId) {
func Uint64ToNeedleId(needleId uint64) NeedleId {
return NeedleId(needleId)
}
func BytesToNeedleId(bytes []byte) (NeedleId) {
func BytesToNeedleId(bytes []byte) NeedleId {
return NeedleId(util.BytesToUint64(bytes))
}

12
weed/storage/types/needle_types.go

@ -1,10 +1,10 @@
package types
import (
"math"
"fmt"
"github.com/chrislusf/seaweedfs/weed/util"
"math"
"strconv"
"fmt"
)
type Offset uint32
@ -23,11 +23,11 @@ const (
func CookieToBytes(bytes []byte, cookie Cookie) {
util.Uint32toBytes(bytes, uint32(cookie))
}
func Uint32ToCookie(cookie uint32) (Cookie) {
func Uint32ToCookie(cookie uint32) Cookie {
return Cookie(cookie)
}
func BytesToCookie(bytes []byte) (Cookie) {
func BytesToCookie(bytes []byte) Cookie {
return Cookie(util.BytesToUint32(bytes[0:4]))
}
@ -43,10 +43,10 @@ func OffsetToBytes(bytes []byte, offset Offset) {
util.Uint32toBytes(bytes, uint32(offset))
}
func Uint32ToOffset(offset uint32) (Offset) {
func Uint32ToOffset(offset uint32) Offset {
return Offset(offset)
}
func BytesToOffset(bytes []byte) (Offset) {
func BytesToOffset(bytes []byte) Offset {
return Offset(util.BytesToUint32(bytes[0:4]))
}

2
weed/storage/volume_vacuum.go

@ -5,8 +5,8 @@ import (
"os"
"time"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/util"
)

2
weed/storage/volume_vacuum_test.go

@ -1,11 +1,11 @@
package storage
import (
"github.com/chrislusf/seaweedfs/weed/storage/types"
"io/ioutil"
"math/rand"
"os"
"testing"
"github.com/chrislusf/seaweedfs/weed/storage/types"
)
/*

Loading…
Cancel
Save