Skip to content

Commit

Permalink
chore!: changed package path and repository name (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Jun 18, 2023
1 parent 0400fe4 commit 5204197
Show file tree
Hide file tree
Showing 18 changed files with 75 additions and 57 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Therefore, a dax interface can make clear which methods are used in a logic. And

The usage of this framework is described on the overview in the go package document.

See https://pkg.go.dev/github.com/sttk-go/sabi#pkg-overview.
See https://pkg.go.dev/github.com/sttk/sabi#pkg-overview.


## Supporting Go versions
Expand All @@ -46,15 +46,15 @@ This framework supports Go 1.18 or later.
% gvm-fav
Now using version go1.18.10
go version go1.18.10 darwin/amd64
ok github.com/sttk-go/sabi 0.834s coverage: 99.6% of statements
ok github.com/sttk/sabi 0.834s coverage: 99.6% of statements
Now using version go1.19.5
go version go1.19.5 darwin/amd64
ok github.com/sttk-go/sabi 0.836s coverage: 99.6% of statements
ok github.com/sttk/sabi 0.836s coverage: 99.6% of statements
Now using version go1.20
go version go1.20 darwin/amd64
ok github.com/sttk-go/sabi 0.843s coverage: 99.6% of statements
ok github.com/sttk/sabi 0.843s coverage: 99.6% of statements
Back to go1.20
Now using version go1.20
Expand All @@ -70,10 +70,10 @@ This program is free software under MIT License.<br>
See the file LICENSE in this distribution for more details.


[repo-url]: https://github.com/sttk-go/sabi
[pkg-dev-img]: https://pkg.go.dev/badge/github.com/sttk-go/sabi.svg
[pkg-dev-url]: https://pkg.go.dev/github.com/sttk-go/sabi
[ci-img]: https://github.com/sttk-go/sabi/actions/workflows/go.yml/badge.svg?branch=main
[ci-url]: https://github.com/sttk-go/sabi/actions
[repo-url]: https://github.com/sttk/sabi-go
[pkg-dev-img]: https://pkg.go.dev/badge/github.com/sttk/sabi.svg
[pkg-dev-url]: https://pkg.go.dev/github.com/sttk/sabi
[ci-img]: https://github.com/sttk/sabi-go/actions/workflows/go.yml/badge.svg?branch=main
[ci-url]: https://github.com/sttk/sabi-go/actions
[mit-img]: https://img.shields.io/badge/license-MIT-green.svg
[mit-url]: https://opensource.org/licenses/MIT
3 changes: 2 additions & 1 deletion benchmark/dax_src/benchmark_dax_src_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package sabi_test

import (
"github.com/sttk-go/sabi"
"testing"

"github.com/sttk/sabi"
)

type FooDaxConn struct{}
Expand Down
3 changes: 2 additions & 1 deletion benchmark/err/benchmark_err_test.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package sabi_test

import (
"github.com/sttk-go/sabi"
"strconv"
"testing"

"github.com/sttk/sabi"
)

func unused(v any) {}
Expand Down
3 changes: 2 additions & 1 deletion benchmark/notify/benchmark_notify_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package sabi_test

import (
"github.com/sttk-go/sabi"
"testing"

"github.com/sttk/sabi"
)

func unused(v any) {}
Expand Down
3 changes: 2 additions & 1 deletion dax_dummy_for_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ package sabi_test

import (
"container/list"
"github.com/sttk-go/sabi"

"github.com/sttk/sabi"
)

var (
Expand Down
34 changes: 18 additions & 16 deletions dax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package sabi_test

import (
"fmt"
"github.com/stretchr/testify/assert"
"github.com/sttk-go/sabi"
"testing"

"github.com/stretchr/testify/assert"

"github.com/sttk/sabi"
)

func TestAddGlobalDaxSrc(t *testing.T) {
Expand Down Expand Up @@ -773,12 +775,12 @@ func TestGetDaxConn_whenDaxConnIsValueButError(t *testing.T) {
conn, err := sabi.GetDaxConn[*BarDaxConn](base, "foo")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "FailToCastDaxConn")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "foo")
assert.Equal(t, err.Get("FromType"),
"FooDaxConn (github.com/sttk-go/sabi_test)")
"FooDaxConn (github.com/sttk/sabi_test)")
assert.Equal(t, err.Get("ToType"),
"*BarDaxConn (github.com/sttk-go/sabi_test)")
"*BarDaxConn (github.com/sttk/sabi_test)")
assert.Nil(t, conn)
}

Expand All @@ -791,12 +793,12 @@ func TestGetDaxConn_whenDaxConnIsValueButPointer(t *testing.T) {
conn, err := sabi.GetDaxConn[*FooDaxConn](base, "foo")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "FailToCastDaxConn")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "foo")
assert.Equal(t, err.Get("FromType"),
"FooDaxConn (github.com/sttk-go/sabi_test)")
"FooDaxConn (github.com/sttk/sabi_test)")
assert.Equal(t, err.Get("ToType"),
"*FooDaxConn (github.com/sttk-go/sabi_test)")
"*FooDaxConn (github.com/sttk/sabi_test)")
assert.Nil(t, conn)
}

Expand All @@ -821,12 +823,12 @@ func TestGetDaxConn_whenDaxConnIsPointerButError(t *testing.T) {
conn, err := sabi.GetDaxConn[*FooDaxConn](base, "bar")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "FailToCastDaxConn")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "bar")
assert.Equal(t, err.Get("FromType"),
"*BarDaxConn (github.com/sttk-go/sabi_test)")
"*BarDaxConn (github.com/sttk/sabi_test)")
assert.Equal(t, err.Get("ToType"),
"*FooDaxConn (github.com/sttk-go/sabi_test)")
"*FooDaxConn (github.com/sttk/sabi_test)")
assert.Nil(t, conn)
}

Expand All @@ -840,12 +842,12 @@ func TestGetDaxConn_whenDaxConnIsPointerButValue(t *testing.T) {
conn, err := sabi.GetDaxConn[BarDaxConn](base, "bar")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "FailToCastDaxConn")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "bar")
assert.Equal(t, err.Get("FromType"),
"*BarDaxConn (github.com/sttk-go/sabi_test)")
"*BarDaxConn (github.com/sttk/sabi_test)")
assert.Equal(t, err.Get("ToType"),
"BarDaxConn (github.com/sttk-go/sabi_test)")
"BarDaxConn (github.com/sttk/sabi_test)")
assert.NotNil(t, conn)
}
*/
Expand All @@ -858,7 +860,7 @@ func TestGetDaxConn_whenDaxConnIsNotFound(t *testing.T) {
conn, err := sabi.GetDaxConn[FooDaxConn](base, "foo")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "DaxSrcIsNotFound")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "foo")
assert.NotNil(t, conn)
}
Expand All @@ -874,7 +876,7 @@ func TestGetDaxConn_whenDaxConnIsFailedToCreate(t *testing.T) {
conn, err := sabi.GetDaxConn[FooDaxConn](base, "foo")
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "FailToCreateDaxConn")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi")
assert.Equal(t, err.Get("Name"), "foo")
assert.NotNil(t, conn)
}
4 changes: 2 additions & 2 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// See the file LICENSE in this distribution for more details.

/*
Package github.com/sttk-go/sabi is a small framework to separate logic parts and data accesses parts for Golang applications.
Package github.com/sttk/sabi is a small framework to separate logic parts and data accesses parts for Golang applications.
# Logic
Expand All @@ -15,7 +15,7 @@ In this logic part, it's no concern where a data comes from or goes to.
For example, in the following code, GreetLogic is a logic function and GreetDax is a dax interface.
import "github.com/sttk-go/sabi"
import "github.com/sttk/sabi"
type GreetDax interface {
UserName() (string, sabi.Err)
Expand Down
6 changes: 4 additions & 2 deletions doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package sabi_test

import (
"fmt"
"github.com/stretchr/testify/assert"
"github.com/sttk-go/sabi"
"testing"

"github.com/stretchr/testify/assert"

"github.com/sttk/sabi"
)

type GreetDax interface {
Expand Down
14 changes: 8 additions & 6 deletions err_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ package sabi_test

import (
"errors"
"github.com/stretchr/testify/assert"
"github.com/sttk-go/sabi"
"testing"

"github.com/stretchr/testify/assert"

"github.com/sttk/sabi"
)

type /* error reasons */ (
Expand Down Expand Up @@ -38,7 +40,7 @@ func TestNewErr_reasonIsValue(t *testing.T) {
assert.False(t, err.IsOk())
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "InvalidValue")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi_test")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi_test")
assert.Equal(t, err.Get("Value"), "abc")
assert.Nil(t, err.Get("value"))
assert.Nil(t, err.Get("Name"))
Expand Down Expand Up @@ -74,7 +76,7 @@ func TestNewErr_reasonIsPointer(t *testing.T) {
assert.False(t, err.IsOk())
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "InvalidValue")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi_test")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi_test")
assert.Equal(t, err.Get("Value"), "abc")
assert.Nil(t, err.Get("value"))
assert.Nil(t, err.Get("Name"))
Expand Down Expand Up @@ -111,7 +113,7 @@ func TestNewErr_withCause(t *testing.T) {
assert.False(t, err.IsOk())
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "InvalidValue")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi_test")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi_test")
assert.Equal(t, err.Get("Value"), "abc")
assert.Nil(t, err.Get("value"))
assert.Nil(t, err.Get("Name"))
Expand Down Expand Up @@ -150,7 +152,7 @@ func TestNewErr_causeIsAlsoErr(t *testing.T) {
assert.False(t, err.IsOk())
assert.True(t, err.IsNotOk())
assert.Equal(t, err.ReasonName(), "InvalidValue")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk-go/sabi_test")
assert.Equal(t, err.ReasonPackage(), "github.com/sttk/sabi_test")

assert.Equal(t, err.Get("Value"), "abc")
assert.Equal(t, err.Get("Name"), "foo")
Expand Down
3 changes: 2 additions & 1 deletion example_dax_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package sabi_test

import (
"fmt"
"github.com/sttk-go/sabi"
"reflect"

"github.com/sttk/sabi"
)

func ExampleAddGlobalDaxSrc() {
Expand Down
5 changes: 3 additions & 2 deletions example_err_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ package sabi_test
import (
"errors"
"fmt"
"github.com/sttk-go/sabi"

"github.com/sttk/sabi"
)

func ExampleNewErr() {
Expand Down Expand Up @@ -164,7 +165,7 @@ func ExampleErr_ReasonPackage() {
fmt.Printf("%v\n", err.ReasonPackage())

// Output:
// github.com/sttk-go/sabi_test
// github.com/sttk/sabi_test
}

func ExampleErr_Situation() {
Expand Down
5 changes: 3 additions & 2 deletions example_notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package sabi_test

import (
"fmt"
"github.com/sttk-go/sabi"
"strconv"
"time"

"github.com/sttk/sabi"
)

func ExampleAddAsyncErrHandler() {
Expand Down Expand Up @@ -57,7 +58,7 @@ func ExampleFixErrCfgs() {
sabi.NewErr(FailToDoSomething{Name: "abc"})

// Output:
// This handler is registered at example_notify_test.go:57
// This handler is registered at example_notify_test.go:58

sabi.ClearErrHandlers()
}
2 changes: 1 addition & 1 deletion example_runner_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sabi_test

import (
"github.com/sttk-go/sabi"
"github.com/sttk/sabi"
)

func unused(v any) {}
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module github.com/sttk-go/sabi
module github.com/sttk/sabi

go 1.18

require github.com/stretchr/testify v1.8.3
require github.com/stretchr/testify v1.8.4

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.3 h1:RP3t2pwF7cMEbC1dqtB6poj3niw/9gnV4Cjg5oW5gtY=
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
Expand Down
9 changes: 5 additions & 4 deletions notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package sabi

import (
"container/list"
"github.com/stretchr/testify/assert"
"reflect"
"strconv"
"testing"
"time"

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

type ReasonForNotification struct{}
Expand Down Expand Up @@ -201,13 +202,13 @@ func TestNotifyErr_withHandlers(t *testing.T) {

assert.Equal(t, syncLogs.Len(), 2)
assert.Equal(t, syncLogs.Front().Value,
"ReasonForNotification-1:notify_test.go:198")
"ReasonForNotification-1:notify_test.go:199")
assert.Equal(t, syncLogs.Front().Next().Value,
"ReasonForNotification-2:notify_test.go:198")
"ReasonForNotification-2:notify_test.go:199")

time.Sleep(100 * time.Millisecond)

assert.Equal(t, asyncLogs.Len(), 1)
assert.Equal(t, asyncLogs.Front().Value,
"ReasonForNotification-3:notify_test.go:198")
"ReasonForNotification-3:notify_test.go:199")
}
6 changes: 4 additions & 2 deletions runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ package sabi_test

import (
"container/list"
"github.com/stretchr/testify/assert"
"github.com/sttk-go/sabi"
"testing"
"time"

"github.com/stretchr/testify/assert"

"github.com/sttk/sabi"
)

var runnerLogs list.List
Expand Down
Loading

0 comments on commit 5204197

Please sign in to comment.