Skip to content

Commit

Permalink
replace declares its path
Browse files Browse the repository at this point in the history
  • Loading branch information
seanbao committed Apr 3, 2023
1 parent 6470b47 commit 91fa181
Show file tree
Hide file tree
Showing 77 changed files with 181 additions and 181 deletions.
2 changes: 1 addition & 1 deletion .sage/go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.einride.tech/can/.sage
module github.com/seanbao/can-go/.sage

go 1.19

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
:electric_plug: CAN Go
======================

[![PkgGoDev](https://pkg.go.dev/badge/go.einride.tech/can)](https://pkg.go.dev/go.einride.tech/can) [![GoReportCard](https://goreportcard.com/badge/go.einride.tech/can)](https://goreportcard.com/report/go.einride.tech/can) [![Codecov](https://codecov.io/gh/einride/can-go/branch/master/graph/badge.svg)](https://codecov.io/gh/einride/can-go)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/seanbao/can-go)](https://pkg.go.dev/github.com/seanbao/can-go) [![GoReportCard](https://goreportcard.com/badge/github.com/seanbao/can-go)](https://goreportcard.com/report/github.com/seanbao/can-go) [![Codecov](https://codecov.io/gh/einride/can-go/branch/master/graph/badge.svg)](https://codecov.io/gh/einride/can-go)

CAN toolkit for Go programmers.

Expand Down Expand Up @@ -60,7 +60,7 @@ func main() {
It is possible to generate Go code from a `.dbc` file.

```
$ go run go.einride.tech/can/cmd/cantool generate <dbc file root folder> <output folder>
$ go run github.com/seanbao/can-go/cmd/cantool generate <dbc file root folder> <output folder>
```

In order to generate Go code that makes sense, we currently perform some validations when parsing the DBC file so there may need to be some changes on the DBC file to make it work
Expand Down
2 changes: 1 addition & 1 deletion can.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package can provides primitives for working with CAN.
//
// See: https://en.wikipedia.org/wiki/CAN_bus
package can // import "go.einride.tech/can"
package can // import "github.com/seanbao/can-go"
42 changes: 21 additions & 21 deletions cmd/cantool/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,27 @@ import (
"text/scanner"

"github.com/fatih/color"
"go.einride.tech/can/internal/generate"
"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/dbc/analysis"
"go.einride.tech/can/pkg/dbc/analysis/passes/definitiontypeorder"
"go.einride.tech/can/pkg/dbc/analysis/passes/intervals"
"go.einride.tech/can/pkg/dbc/analysis/passes/lineendings"
"go.einride.tech/can/pkg/dbc/analysis/passes/messagenames"
"go.einride.tech/can/pkg/dbc/analysis/passes/multiplexedsignals"
"go.einride.tech/can/pkg/dbc/analysis/passes/newsymbols"
"go.einride.tech/can/pkg/dbc/analysis/passes/nodereferences"
"go.einride.tech/can/pkg/dbc/analysis/passes/noreservedsignals"
"go.einride.tech/can/pkg/dbc/analysis/passes/requireddefinitions"
"go.einride.tech/can/pkg/dbc/analysis/passes/signalbounds"
"go.einride.tech/can/pkg/dbc/analysis/passes/signalnames"
"go.einride.tech/can/pkg/dbc/analysis/passes/singletondefinitions"
"go.einride.tech/can/pkg/dbc/analysis/passes/siunits"
"go.einride.tech/can/pkg/dbc/analysis/passes/uniquenodenames"
"go.einride.tech/can/pkg/dbc/analysis/passes/uniquesignalnames"
"go.einride.tech/can/pkg/dbc/analysis/passes/unitsuffixes"
"go.einride.tech/can/pkg/dbc/analysis/passes/valuedescriptions"
"go.einride.tech/can/pkg/dbc/analysis/passes/version"
"github.com/seanbao/can-go/internal/generate"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/definitiontypeorder"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/intervals"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/lineendings"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/messagenames"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/multiplexedsignals"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/newsymbols"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/nodereferences"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/noreservedsignals"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/requireddefinitions"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/signalbounds"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/signalnames"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/singletondefinitions"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/siunits"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/uniquenodenames"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/uniquesignalnames"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/unitsuffixes"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/valuedescriptions"
"github.com/seanbao/can-go/pkg/dbc/analysis/passes/version"
"gopkg.in/alecthomas/kingpin.v2"
)

Expand Down
2 changes: 1 addition & 1 deletion data.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package can
import (
"fmt"

"go.einride.tech/can/internal/reinterpret"
"github.com/seanbao/can-go/internal/reinterpret"
)

const MaxDataLength = 8
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module go.einride.tech/can
module github.com/seanbao/can-go

go 1.19

Expand Down
4 changes: 2 additions & 2 deletions internal/generate/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"sort"
"time"

"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/descriptor"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/descriptor"
)

type CompileResult struct {
Expand Down
4 changes: 2 additions & 2 deletions internal/generate/compile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"testing"
"time"

"go.einride.tech/can/pkg/descriptor"
examplecan "go.einride.tech/can/testdata/gen/go/example"
"github.com/seanbao/can-go/pkg/descriptor"
examplecan "github.com/seanbao/can-go/testdata/gen/go/example"
"gotest.tools/v3/assert"
)

Expand Down
8 changes: 4 additions & 4 deletions internal/generate/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"testing"
"time"

"go.einride.tech/can"
"go.einride.tech/can/pkg/generated"
"go.einride.tech/can/pkg/socketcan"
examplecan "go.einride.tech/can/testdata/gen/go/example"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/pkg/generated"
"github.com/seanbao/can-go/pkg/socketcan"
examplecan "github.com/seanbao/can-go/testdata/gen/go/example"
"golang.org/x/sync/errgroup"
"gotest.tools/v3/assert"
)
Expand Down
16 changes: 8 additions & 8 deletions internal/generate/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"regexp"
"strings"

"github.com/seanbao/can-go/pkg/descriptor"
"github.com/shurcooL/go-goon"
"go.einride.tech/can/pkg/descriptor"
)

type File struct {
Expand Down Expand Up @@ -100,13 +100,13 @@ func Imports(f *File) {
f.P(`"sync"`)
f.P(`"time"`)
f.P()
f.P(`"go.einride.tech/can"`)
f.P(`"go.einride.tech/can/pkg/socketcan"`)
f.P(`"go.einride.tech/can/pkg/candebug"`)
f.P(`"go.einride.tech/can/pkg/canrunner"`)
f.P(`"go.einride.tech/can/pkg/descriptor"`)
f.P(`"go.einride.tech/can/pkg/generated"`)
f.P(`"go.einride.tech/can/pkg/cantext"`)
f.P(`"github.com/seanbao/can-go"`)
f.P(`"github.com/seanbao/can-go/pkg/socketcan"`)
f.P(`"github.com/seanbao/can-go/pkg/candebug"`)
f.P(`"github.com/seanbao/can-go/pkg/canrunner"`)
f.P(`"github.com/seanbao/can-go/pkg/descriptor"`)
f.P(`"github.com/seanbao/can-go/pkg/generated"`)
f.P(`"github.com/seanbao/can-go/pkg/cantext"`)
f.P(")")
f.P()
// we could use goimports for this, but it significantly slows down code generation
Expand Down
4 changes: 2 additions & 2 deletions internal/mocks/gen.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package mocks

//go:generate mockgen -destination gen/mockclock/mocks.go -package mockclock go.einride.tech/can/internal/clock Clock,Ticker
//go:generate mockgen -destination gen/mockclock/mocks.go -package mockclock github.com/seanbao/can-go/internal/clock Clock,Ticker
//go:generate mockgen -destination gen/mocksocketcan/mocks.go -package mocksocketcan -source ../../pkg/socketcan/fileconn.go
//go:generate mockgen -destination gen/mockcanrunner/mocks.go -package mockcanrunner go.einride.tech/can/pkg/canrunner Node,TransmittedMessage,ReceivedMessage,FrameTransmitter,FrameReceiver
//go:generate mockgen -destination gen/mockcanrunner/mocks.go -package mockcanrunner github.com/seanbao/can-go/pkg/canrunner Node,TransmittedMessage,ReceivedMessage,FrameTransmitter,FrameReceiver
8 changes: 4 additions & 4 deletions internal/mocks/gen/mockcanrunner/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions internal/mocks/gen/mockclock/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions pkg/candebug/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import (
"strconv"
"time"

"go.einride.tech/can/pkg/cantext"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"github.com/seanbao/can-go/pkg/cantext"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
)

func ServeMessagesHTTP(w http.ResponseWriter, r *http.Request, msgs []generated.Message) {
Expand Down
6 changes: 3 additions & 3 deletions pkg/candebug/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import (
"testing"
"time"

"go.einride.tech/can"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
"gotest.tools/v3/assert"
)

Expand Down
6 changes: 3 additions & 3 deletions pkg/canjson/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"strconv"

"go.einride.tech/can"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
)

// preAllocatedBytesPerSignal is an estimate of how many bytes each signal needs.
Expand Down
2 changes: 1 addition & 1 deletion pkg/canjson/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"testing"

examplecan "go.einride.tech/can/testdata/gen/go/example"
examplecan "github.com/seanbao/can-go/testdata/gen/go/example"
"gotest.tools/v3/assert"
)

Expand Down
10 changes: 5 additions & 5 deletions pkg/canrunner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"sync"
"time"

"go.einride.tech/can"
"go.einride.tech/can/internal/clock"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"go.einride.tech/can/pkg/socketcan"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/internal/clock"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
"github.com/seanbao/can-go/pkg/socketcan"
"golang.org/x/sync/errgroup"
)

Expand Down
10 changes: 5 additions & 5 deletions pkg/canrunner/run_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import (
"time"

"github.com/golang/mock/gomock"
"go.einride.tech/can"
"go.einride.tech/can/internal/mocks/gen/mockcanrunner"
"go.einride.tech/can/internal/mocks/gen/mockclock"
"go.einride.tech/can/pkg/canrunner"
"go.einride.tech/can/pkg/descriptor"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/internal/mocks/gen/mockcanrunner"
"github.com/seanbao/can-go/internal/mocks/gen/mockclock"
"github.com/seanbao/can-go/pkg/canrunner"
"github.com/seanbao/can-go/pkg/descriptor"
"golang.org/x/sync/errgroup"
"gotest.tools/v3/assert"
)
Expand Down
6 changes: 3 additions & 3 deletions pkg/cantext/encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package cantext
import (
"strconv"

"go.einride.tech/can"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
)

// preAllocatedBytesPerSignal is an estimate of how many bytes each signal needs.
Expand Down
6 changes: 3 additions & 3 deletions pkg/cantext/encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

"go.einride.tech/can"
"go.einride.tech/can/pkg/descriptor"
"go.einride.tech/can/pkg/generated"
"github.com/seanbao/can-go"
"github.com/seanbao/can-go/pkg/descriptor"
"github.com/seanbao/can-go/pkg/generated"
"gotest.tools/v3/assert"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/dbc/analysis/analysis.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"strings"
"text/scanner"

"go.einride.tech/can/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc"
)

// An Analyzer describes an analysis function and its options.
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/analysistest/analysistest.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"strings"
"testing"

"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc/analysis"
"gotest.tools/v3/assert"
)

Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/boolprefix/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package boolprefix
import (
"strings"

"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc/analysis"
)

func Analyzer() *analysis.Analyzer {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/boolprefix/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"text/scanner"

"go.einride.tech/can/pkg/dbc/analysis"
"go.einride.tech/can/pkg/dbc/analysis/analysistest"
"github.com/seanbao/can-go/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc/analysis/analysistest"
)

func TestAnalyzer(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/definitiontypeorder/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"math"
"reflect"

"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc/analysis"
)

func Analyzer() *analysis.Analyzer {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/definitiontypeorder/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"text/scanner"

"go.einride.tech/can/pkg/dbc/analysis"
"go.einride.tech/can/pkg/dbc/analysis/analysistest"
"github.com/seanbao/can-go/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc/analysis/analysistest"
)

func TestAnalyzer(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/intervals/analyzer.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package intervals

import (
"go.einride.tech/can/pkg/dbc"
"go.einride.tech/can/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc"
"github.com/seanbao/can-go/pkg/dbc/analysis"
)

func Analyzer() *analysis.Analyzer {
Expand Down
4 changes: 2 additions & 2 deletions pkg/dbc/analysis/passes/intervals/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"text/scanner"

"go.einride.tech/can/pkg/dbc/analysis"
"go.einride.tech/can/pkg/dbc/analysis/analysistest"
"github.com/seanbao/can-go/pkg/dbc/analysis"
"github.com/seanbao/can-go/pkg/dbc/analysis/analysistest"
)

func TestAnalyzer(t *testing.T) {
Expand Down
Loading

0 comments on commit 91fa181

Please sign in to comment.