Skip to content

Commit

Permalink
Format imports
Browse files Browse the repository at this point in the history
  • Loading branch information
viktb committed May 15, 2023
1 parent 609dab4 commit ed508f2
Show file tree
Hide file tree
Showing 15 changed files with 45 additions and 20 deletions.
6 changes: 4 additions & 2 deletions cmd/asnlookup-utils/convert.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package main

import (
"github.com/banviktor/asnlookup/pkg/database"
"github.com/urfave/cli/v2"
"log"
"os"

"github.com/urfave/cli/v2"

"github.com/banviktor/asnlookup/pkg/database"
)

var convertCommand = &cli.Command{
Expand Down
3 changes: 2 additions & 1 deletion cmd/asnlookup-utils/main.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package main

import (
"github.com/urfave/cli/v2"
"log"
"os"

"github.com/urfave/cli/v2"
)

func main() {
Expand Down
4 changes: 3 additions & 1 deletion cmd/asnlookup-utils/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package main

import (
"fmt"
"github.com/banviktor/asnlookup"

"github.com/urfave/cli/v2"

"github.com/banviktor/asnlookup"
)

var versionCommand = &cli.Command{
Expand Down
5 changes: 3 additions & 2 deletions cmd/asnlookup/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import (
"bufio"
"flag"
"fmt"
"github.com/banviktor/asnlookup"
"github.com/banviktor/asnlookup/pkg/database"
"net"
"os"

"github.com/banviktor/asnlookup"
"github.com/banviktor/asnlookup/pkg/database"
)

const (
Expand Down
4 changes: 3 additions & 1 deletion pkg/binarytrie/arraymarshaling.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package binarytrie

import "encoding/binary"
import (
"encoding/binary"
)

const (
arrayTrieMarshalHeader = "github.com/banviktor/asnlookup/pkg/binarytrie\x00ArrayTrie\x00"
Expand Down
6 changes: 4 additions & 2 deletions pkg/binarytrie/arraymarshaling_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
package binarytrie_test

import (
. "github.com/banviktor/asnlookup/pkg/binarytrie"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"

. "github.com/banviktor/asnlookup/pkg/binarytrie"
)

func TestEmptyMarshaledArrayTrieLookup(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/binarytrie/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package binarytrie

import "errors"
import (
"errors"
)

var (
// ErrInvalidIPAddress IP address is invalid.
Expand Down
6 changes: 4 additions & 2 deletions pkg/binarytrie/naive_test.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
package binarytrie_test

import (
. "github.com/banviktor/asnlookup/pkg/binarytrie"
"github.com/stretchr/testify/assert"
"net"
"testing"

"github.com/stretchr/testify/assert"

. "github.com/banviktor/asnlookup/pkg/binarytrie"
)

type testCase struct {
Expand Down
4 changes: 3 additions & 1 deletion pkg/binarytrie/optimize.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package binarytrie

import "sync"
import (
"sync"
)

// Optimize performs level compression and path compression on the trie.
//
Expand Down
3 changes: 2 additions & 1 deletion pkg/binarytrie/optimize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package binarytrie_test

import (
"fmt"
"github.com/stretchr/testify/assert"
"testing"

"github.com/stretchr/testify/assert"
)

func TestEmptyOptimizedNaiveTrieLookup(t *testing.T) {
Expand Down
4 changes: 3 additions & 1 deletion pkg/binarytrie/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package binarytrie

import "net"
import (
"net"
)

func parseIpNet(ipNet *net.IPNet) (net.IP, int, error) {
ip := ipNet.IP.To16()
Expand Down
6 changes: 4 additions & 2 deletions pkg/database/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package database

import (
"fmt"
"github.com/banviktor/asnlookup/pkg/binarytrie"
"github.com/kaorimatz/go-mrt"
"io"
"net"

"github.com/kaorimatz/go-mrt"

"github.com/banviktor/asnlookup/pkg/binarytrie"
)

type builder struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/database/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package database
import (
"encoding"
"fmt"
"github.com/banviktor/asnlookup/pkg/binarytrie"
"io"
"io/ioutil"
"net"

"github.com/banviktor/asnlookup/pkg/binarytrie"
)

// AutonomousSystem represents an Autonomous System on the Internet.
Expand Down
4 changes: 3 additions & 1 deletion pkg/database/errors.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package database

import "errors"
import (
"errors"
)

var (
// ErrNotFound AS not found.
Expand Down
3 changes: 2 additions & 1 deletion pkg/database/mrt.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package database
import (
"encoding/binary"
"errors"
"github.com/kaorimatz/go-mrt"
"net"

"github.com/kaorimatz/go-mrt"
)

func mrtRIBToMapping(rib *mrt.TableDumpV2RIB) (*net.IPNet, uint32, error) {
Expand Down

0 comments on commit ed508f2

Please sign in to comment.