grumble, pkg/*: go fmt.

This commit is contained in:
Mikkel Krautz 2012-11-18 17:59:07 +01:00
parent d77f8843a7
commit dd76f22eb7
14 changed files with 62 additions and 61 deletions

1
acl.go
View file

@ -55,6 +55,7 @@ func (perm Permission) ClearCacheBit() {
// A channel-to-permission mapping used in the ACLCache // A channel-to-permission mapping used in the ACLCache
type ChannelCache map[int]Permission type ChannelCache map[int]Permission
// The ACLCache maps a user id to a ChannelCache map. // The ACLCache maps a user id to a ChannelCache map.
// The ChannelCache map maps a channel to its permissions. // The ChannelCache map maps a channel to its permissions.
type ACLCache map[uint32]ChannelCache type ACLCache map[uint32]ChannelCache

View file

@ -72,7 +72,7 @@ func defaultLogPath() string {
func Usage() { func Usage() {
t, err := template.New("usage").Parse(usageTmpl) t, err := template.New("usage").Parse(usageTmpl)
if err != nil { if err != nil {
panic("unable to parse usage template") panic("unable to parse usage template")
} }
err = t.Execute(os.Stdout, UsageArgs{ err = t.Execute(os.Stdout, UsageArgs{

View file

@ -7,13 +7,13 @@ package main
import ( import (
"code.google.com/p/goprotobuf/proto" "code.google.com/p/goprotobuf/proto"
"errors" "errors"
"io"
"io/ioutil"
"log"
"mumbleapp.com/grumble/pkg/ban" "mumbleapp.com/grumble/pkg/ban"
"mumbleapp.com/grumble/pkg/freezer" "mumbleapp.com/grumble/pkg/freezer"
"mumbleapp.com/grumble/pkg/mumbleproto" "mumbleapp.com/grumble/pkg/mumbleproto"
"mumbleapp.com/grumble/pkg/serverconf" "mumbleapp.com/grumble/pkg/serverconf"
"io"
"io/ioutil"
"log"
"os" "os"
"path/filepath" "path/filepath"
"strconv" "strconv"

View file

@ -7,9 +7,9 @@ package main
import ( import (
"flag" "flag"
"fmt" "fmt"
"log"
"mumbleapp.com/grumble/pkg/blobstore" "mumbleapp.com/grumble/pkg/blobstore"
"mumbleapp.com/grumble/pkg/logtarget" "mumbleapp.com/grumble/pkg/logtarget"
"log"
"os" "os"
"path/filepath" "path/filepath"
"regexp" "regexp"

View file

@ -10,11 +10,11 @@ package main
// SQLite datbase into a format that Grumble can understand. // SQLite datbase into a format that Grumble can understand.
import ( import (
"database/sql"
"errors" "errors"
"log"
"mumbleapp.com/grumble/pkg/ban" "mumbleapp.com/grumble/pkg/ban"
"mumbleapp.com/grumble/pkg/blobstore" "mumbleapp.com/grumble/pkg/blobstore"
"database/sql"
"log"
"net" "net"
"os" "os"
"path/filepath" "path/filepath"

View file

@ -17,13 +17,13 @@ import (
) )
type BlobStore struct { type BlobStore struct {
dir string dir string
} }
var ( var (
ErrBadFile = errors.New("a bad file exists in the blobstore directory. unable to create container directores.") ErrBadFile = errors.New("a bad file exists in the blobstore directory. unable to create container directores.")
ErrNoSuchKey = errors.New("no such key") ErrNoSuchKey = errors.New("no such key")
ErrInvalidKey = errors.New("invalid key") ErrInvalidKey = errors.New("invalid key")
) )
var ( var (
@ -143,7 +143,7 @@ func NewBlobStore(path string) (bs *BlobStore, err error) {
} }
bs = &BlobStore{ bs = &BlobStore{
dir: path, dir: path,
} }
return bs, nil return bs, nil
} }
@ -281,4 +281,4 @@ func (bs *BlobStore) Put(buf []byte) (key string, err error) {
} }
return key, nil return key, nil
} }

View file

@ -32,7 +32,7 @@ type CryptState struct {
RemoteLost uint32 RemoteLost uint32
RemoteResync uint32 RemoteResync uint32
cipher cipher.Block cipher cipher.Block
} }
func New() (cs *CryptState, err error) { func New() (cs *CryptState, err error) {

View file

@ -5,8 +5,8 @@
package freezer package freezer
import ( import (
"encoding/binary"
"code.google.com/p/goprotobuf/proto" "code.google.com/p/goprotobuf/proto"
"encoding/binary"
"hash" "hash"
"hash/crc32" "hash/crc32"
"io" "io"

View file

@ -1,9 +1,9 @@
package packetdatastream package packetdatastream
import ( import (
"testing"
"math"
"crypto/rand" "crypto/rand"
"math"
"testing"
) )
func TestSelfUint8(t *testing.T) { func TestSelfUint8(t *testing.T) {

View file

@ -1,6 +1,6 @@
// Copyright (c) 2012 The Grumble Authors // Copyright (c) 2012 The Grumble Authors
// The use of this source code is goverened by a BSD-style // The use of this source code is goverened by a BSD-style
// license that can be found in the LICENSE-file. // license that can be found in the LICENSE-file.
// Package replacefile implements access to the ReplaceFile Win32 API. // Package replacefile implements access to the ReplaceFile Win32 API.
package replacefile package replacefile

View file

@ -1,12 +1,12 @@
// Copyright (c) 2012 The Grumble Authors // Copyright (c) 2012 The Grumble Authors
// The use of this source code is goverened by a BSD-style // The use of this source code is goverened by a BSD-style
// license that can be found in the LICENSE-file. // license that can be found in the LICENSE-file.
package replacefile package replacefile
type Flag uint32 type Flag uint32
const ( const (
IgnoreMergeErrors Flag = 0x2 IgnoreMergeErrors Flag = 0x2
IgnoreACLErrors Flag = 0x4 IgnoreACLErrors Flag = 0x4
) )

View file

@ -1,22 +1,22 @@
// Copyright (c) 2012 The Grumble Authors // Copyright (c) 2012 The Grumble Authors
// The use of this source code is goverened by a BSD-style // The use of this source code is goverened by a BSD-style
// license that can be found in the LICENSE-file. // license that can be found in the LICENSE-file.
// +build !windows // +build !windows
package replacefile package replacefile
import ( import (
"errors" "errors"
) )
var ( var (
errOnlyWindows = errors.New("replacefile: only implemented on Windows") errOnlyWindows = errors.New("replacefile: only implemented on Windows")
ErrUnableToMoveReplacement error = errOnlyWindows ErrUnableToMoveReplacement error = errOnlyWindows
ErrUnableToMoveReplacement2 error = errOnlyOnWindows ErrUnableToMoveReplacement2 error = errOnlyOnWindows
ErrUnableToRemoveReplaced error = errOnlyWindows ErrUnableToRemoveReplaced error = errOnlyWindows
) )
func ReplaceFile(replaced string, replacement string, backup string, flags Flag) error { func ReplaceFile(replaced string, replacement string, backup string, flags Flag) error {
return errOnlyWindows return errOnlyWindows
} }

View file

@ -15,6 +15,8 @@ import (
"encoding/hex" "encoding/hex"
"errors" "errors"
"fmt" "fmt"
"hash"
"log"
"mumbleapp.com/grumble/pkg/ban" "mumbleapp.com/grumble/pkg/ban"
"mumbleapp.com/grumble/pkg/blobstore" "mumbleapp.com/grumble/pkg/blobstore"
"mumbleapp.com/grumble/pkg/cryptstate" "mumbleapp.com/grumble/pkg/cryptstate"
@ -24,8 +26,6 @@ import (
"mumbleapp.com/grumble/pkg/mumbleproto" "mumbleapp.com/grumble/pkg/mumbleproto"
"mumbleapp.com/grumble/pkg/serverconf" "mumbleapp.com/grumble/pkg/serverconf"
"mumbleapp.com/grumble/pkg/sessionpool" "mumbleapp.com/grumble/pkg/sessionpool"
"hash"
"log"
"net" "net"
"path/filepath" "path/filepath"
"strings" "strings"

View file

@ -1,6 +1,6 @@
package main package main
var ( var (
version = "1.0~devel" version = "1.0~devel"
buildDate = "unknown" buildDate = "unknown"
) )