Skip to content

Commit

Permalink
formatting code by: goimports -w=true .
Browse files Browse the repository at this point in the history
  • Loading branch information
chrislusf committed Oct 26, 2014
1 parent a5d6e70 commit 179d36b
Show file tree
Hide file tree
Showing 84 changed files with 205 additions and 170 deletions.
6 changes: 3 additions & 3 deletions go/filer/client_operations.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package filer

import ()

import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
"errors"
"fmt"

"github.com/chrislusf/weed-fs/go/util"

"net/url"
)

Expand Down
2 changes: 0 additions & 2 deletions go/filer/directory.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package filer

import ()

type DirectoryId int32

type DirectoryEntry struct {
Expand Down
3 changes: 2 additions & 1 deletion go/filer/directory_in_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ package filer

import (
"bufio"
"github.com/chrislusf/weed-fs/go/util"
"fmt"
"io"
"os"
"path/filepath"
"strconv"
"strings"
"sync"

"github.com/chrislusf/weed-fs/go/util"
)

var writeLock sync.Mutex //serialize changes to dir.log
Expand Down
2 changes: 0 additions & 2 deletions go/filer/filer.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package filer

import ()

type FileId string //file id on weedfs

type FileEntry struct {
Expand Down
3 changes: 2 additions & 1 deletion go/filer/filer_embedded.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package filer

import (
"github.com/chrislusf/weed-fs/go/operation"
"errors"
"fmt"
"path/filepath"
"strings"

"github.com/chrislusf/weed-fs/go/operation"
)

type FilerEmbedded struct {
Expand Down
1 change: 1 addition & 0 deletions go/filer/files_in_leveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package filer

import (
"bytes"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
Expand Down
2 changes: 0 additions & 2 deletions go/glog/convenient_api.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package glog

import ()

/*
Copying the original glog because it is missing several convenient methods.
1. remove nano time in log format
Expand Down
3 changes: 2 additions & 1 deletion go/images/orientation.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package images

import (
"bytes"
"github.com/rwcarlsen/goexif/exif"
"image"
"image/draw"
"image/jpeg"
"log"

"github.com/rwcarlsen/goexif/exif"
)

//many code is copied from http://camlistore.org/pkg/images/images.go
Expand Down
3 changes: 2 additions & 1 deletion go/images/resizing.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package images

import (
"bytes"
"github.com/disintegration/imaging"
"image"
"image/gif"
"image/jpeg"
"image/png"

"github.com/disintegration/imaging"
)

func Resized(ext string, data []byte, width, height int) (resized []byte, w int, h int) {
Expand Down
5 changes: 3 additions & 2 deletions go/operation/assign_file_id.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package operation

import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
"errors"
"net/url"
"strconv"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
)

type AssignResult struct {
Expand Down
2 changes: 0 additions & 2 deletions go/operation/data_struts.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package operation

import ()

type JoinResult struct {
VolumeSizeLimit uint64 `json:"VolumeSizeLimit,omitempty"`
Error string `json:"error,omitempty"`
Expand Down
3 changes: 2 additions & 1 deletion go/operation/delete_content.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package operation

import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
"errors"
"net/url"
"strings"
"sync"

"github.com/chrislusf/weed-fs/go/util"
)

type DeleteResult struct {
Expand Down
3 changes: 2 additions & 1 deletion go/operation/list_masters.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package operation

import (
"encoding/json"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
)

type ClusterStatusResult struct {
Expand Down
3 changes: 2 additions & 1 deletion go/operation/lookup.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
package operation

import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
"errors"
_ "fmt"
"math/rand"
"net/url"
"strings"
"time"

"github.com/chrislusf/weed-fs/go/util"
)

type Location struct {
Expand Down
3 changes: 2 additions & 1 deletion go/operation/submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ package operation

import (
"bytes"
"github.com/chrislusf/weed-fs/go/glog"
"io"
"mime"
"os"
"path"
"strconv"
"strings"

"github.com/chrislusf/weed-fs/go/glog"
)

type FilePart struct {
Expand Down
3 changes: 2 additions & 1 deletion go/operation/system_message_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package operation

import (
proto "code.google.com/p/goprotobuf/proto"
"encoding/json"
"log"
"testing"

proto "code.google.com/p/goprotobuf/proto"
)

func TestSerialDeserial(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion go/operation/upload_content.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package operation

import (
"bytes"
"github.com/chrislusf/weed-fs/go/glog"
"encoding/json"
"errors"
"fmt"
Expand All @@ -14,6 +13,8 @@ import (
"net/textproto"
"path/filepath"
"strings"

"github.com/chrislusf/weed-fs/go/glog"
)

type UploadResult struct {
Expand Down
2 changes: 0 additions & 2 deletions go/sequence/sequence.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package sequence

import ()

type Sequencer interface {
NextFileId(count int) (uint64, int)
SetMax(uint64)
Expand Down
2 changes: 0 additions & 2 deletions go/stats/disk.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package stats

import ()

type DiskStatus struct {
Dir string
All uint64
Expand Down
2 changes: 0 additions & 2 deletions go/stats/disk_notsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package stats

import ()

func (disk *DiskStatus) fillInStatus() {
return
}
2 changes: 0 additions & 2 deletions go/stats/memory_notsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

package stats

import ()

func (mem *MemStatus) fillInStatus() {
return
}
5 changes: 3 additions & 2 deletions go/storage/cdb_map.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/util"
"encoding/json"
"errors"
"fmt"
"github.com/tgulacsi/go-cdb"
"os"
"path/filepath"

"github.com/chrislusf/weed-fs/go/util"
"github.com/tgulacsi/go-cdb"
)

// CDB-backed read-only needle map
Expand Down
3 changes: 2 additions & 1 deletion go/storage/cdb_map_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/glog"
"math/rand"
"os"
"runtime"
"testing"

"github.com/chrislusf/weed-fs/go/glog"
)

var testIndexFilename string = "../../test/sample.idx"
Expand Down
2 changes: 0 additions & 2 deletions go/storage/compact_map.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package storage

import ()

type NeedleValue struct {
Key Key
Offset uint32 `comment:"Volume offset"` //since aligned to 8 bytes, range is 4G*8=32G
Expand Down
5 changes: 3 additions & 2 deletions go/storage/compact_map_perf_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"log"
"os"
"testing"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
)

func TestMemoryUsage(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion go/storage/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package storage

import (
"bytes"
"github.com/chrislusf/weed-fs/go/glog"
"compress/flate"
"compress/gzip"
"io/ioutil"
"strings"

"github.com/chrislusf/weed-fs/go/glog"
)

/*
Expand Down
3 changes: 2 additions & 1 deletion go/storage/crc.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/util"
"fmt"
"hash/crc32"

"github.com/chrislusf/weed-fs/go/util"
)

var table = crc32.MakeTable(crc32.Castagnoli)
Expand Down
5 changes: 3 additions & 2 deletions go/storage/file_id.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"encoding/hex"
"errors"
"strings"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
)

type FileId struct {
Expand Down
7 changes: 4 additions & 3 deletions go/storage/needle.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/util"
"encoding/hex"
"errors"
"io/ioutil"
Expand All @@ -13,6 +10,10 @@ import (
"strconv"
"strings"
"time"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/images"
"github.com/chrislusf/weed-fs/go/util"
)

const (
Expand Down
5 changes: 3 additions & 2 deletions go/storage/needle_map.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
package storage

import (
"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
"fmt"
"io"
"os"

"github.com/chrislusf/weed-fs/go/glog"
"github.com/chrislusf/weed-fs/go/util"
)

type NeedleMapper interface {
Expand Down
Loading

0 comments on commit 179d36b

Please sign in to comment.