Run go fmt and goimports on all files, to make them follow Golang standards

This commit is contained in:
Ola Bini 2019-12-20 22:51:21 +00:00
parent 4a90b31d8d
commit 76138f47fd
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F
15 changed files with 47 additions and 32 deletions

View file

@ -6,6 +6,7 @@ package main
import (
"encoding/hex"
"mumble.info/grumble/pkg/acl"
)

View file

@ -10,16 +10,17 @@ import (
"crypto/tls"
"encoding/binary"
"errors"
"github.com/golang/protobuf/proto"
"io"
"log"
"net"
"runtime"
"time"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/cryptstate"
"mumble.info/grumble/pkg/mumbleproto"
"mumble.info/grumble/pkg/packetdata"
"net"
"runtime"
"time"
)
// A client connection

View file

@ -6,19 +6,20 @@ package main
import (
"errors"
"github.com/golang/protobuf/proto"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"time"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
"mumble.info/grumble/pkg/freezer"
"mumble.info/grumble/pkg/mumbleproto"
"mumble.info/grumble/pkg/serverconf"
"os"
"path/filepath"
"strconv"
"time"
)
// Freeze a server to disk and closes the log file.

View file

@ -7,11 +7,12 @@
package main
import (
"github.com/golang/protobuf/proto"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"github.com/golang/protobuf/proto"
)
func (server *Server) freezeToFile() (err error) {

View file

@ -5,12 +5,13 @@
package main
import (
"github.com/golang/protobuf/proto"
"io/ioutil"
"mumble.info/grumble/pkg/replacefile"
"os"
"path/filepath"
"strconv"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/replacefile"
)
func (server *Server) freezeToFile() (err error) {

View file

@ -8,11 +8,12 @@ import (
"flag"
"fmt"
"log"
"mumble.info/grumble/pkg/blobstore"
"mumble.info/grumble/pkg/logtarget"
"os"
"path/filepath"
"regexp"
"mumble.info/grumble/pkg/blobstore"
"mumble.info/grumble/pkg/logtarget"
)
var servers map[int64]*Server

View file

@ -8,13 +8,14 @@ import (
"crypto/aes"
"crypto/tls"
"fmt"
"net"
"time"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
"mumble.info/grumble/pkg/freezer"
"mumble.info/grumble/pkg/mumbleproto"
"net"
"time"
)
type Message struct {

View file

@ -13,12 +13,13 @@ import (
"database/sql"
"errors"
"log"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
"net"
"os"
"path/filepath"
"strconv"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
)
const (

View file

@ -15,9 +15,16 @@ import (
"encoding/hex"
"errors"
"fmt"
"github.com/golang/protobuf/proto"
"hash"
"log"
"net"
"net/http"
"path/filepath"
"strings"
"sync"
"time"
"github.com/golang/protobuf/proto"
"mumble.info/grumble/pkg/acl"
"mumble.info/grumble/pkg/ban"
"mumble.info/grumble/pkg/freezer"
@ -27,12 +34,6 @@ import (
"mumble.info/grumble/pkg/serverconf"
"mumble.info/grumble/pkg/sessionpool"
"mumble.info/grumble/pkg/web"
"net"
"net/http"
"path/filepath"
"strings"
"sync"
"time"
)
// The default port a Murmur server listens on

View file

@ -8,10 +8,11 @@ package main
import (
"fmt"
"mumble.info/grumble/pkg/logtarget"
"os"
"os/signal"
"syscall"
"mumble.info/grumble/pkg/logtarget"
)
func SignalHandler() {

View file

@ -7,6 +7,7 @@ package cryptstate
import (
"crypto/aes"
"crypto/cipher"
"mumble.info/grumble/pkg/cryptstate/ocb2"
)

View file

@ -5,8 +5,9 @@
package cryptstate
import (
"golang.org/x/crypto/nacl/secretbox"
"unsafe"
"golang.org/x/crypto/nacl/secretbox"
)
// secretBoxMode implements the XSalsa20-Poly1305 CryptoMode

View file

@ -7,12 +7,13 @@ package freezer
import (
"bytes"
"encoding/binary"
"github.com/golang/protobuf/proto"
"hash/crc32"
"io"
"math"
"os"
"testing"
"github.com/golang/protobuf/proto"
)
var testValues []proto.Message = []proto.Message{

View file

@ -6,11 +6,12 @@ package freezer
import (
"encoding/binary"
"github.com/golang/protobuf/proto"
"hash"
"hash/crc32"
"io"
"math"
"github.com/golang/protobuf/proto"
)
// Checks whether the error err is an EOF

View file

@ -18,12 +18,13 @@ package freezer
import (
"bytes"
"encoding/binary"
"github.com/golang/protobuf/proto"
"hash"
"hash/crc32"
"io"
"math"
"os"
"github.com/golang/protobuf/proto"
)
// Log implements an append-only log for flattened