Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![GoDoc][1]][2] [![Build Status][7]][8] [![Codecov][9]][10] [![Release][5]][6] [![license-Apache 2][3]][4]

[1]: https://godoc.org/github.com/go-spring-projects/go-spring?status.svg
[2]: https://godoc.org/github.com/go-spring-projects/go-spring
[1]: https://godoc.org/go-spring.dev/spring?status.svg
[2]: https://godoc.org/go-spring.dev/spring
[3]: https://img.shields.io/badge/license-Apache%202-blue.svg
[4]: LICENSE
[5]: https://img.shields.io/github/v/release/go-spring-projects/go-spring?color=orange
Expand All @@ -22,7 +22,7 @@ This project initial code based from [go-spring/go-spring](https://github.com/go
English | [中文](README_CN.md)

### Install
`go get github.com/go-spring-projects/go-spring@latest`
`go get go-spring.dev/spring@latest`

### Features
* **IoC Container**: Implements an inversion of control (IoC) container based on reflection, supporting the injection of structs, functions, and constants. This means you can use the `autowired` tag to automatically inject dependencies without having to manage them manually.
Expand Down Expand Up @@ -69,7 +69,7 @@ import (
"context"
"log/slog"

"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/gs"
)

type MyApp struct {
Expand Down Expand Up @@ -98,7 +98,7 @@ func main() {
```go
package mypkg

import "github.com/go-spring-projects/go-spring/gs"
import "go-spring.dev/spring/gs"

type MyApp struct {}

Expand Down Expand Up @@ -209,8 +209,8 @@ import (
"fmt"
"log/slog"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/gs"
"gopkg.in/validator.v2"
)

Expand Down Expand Up @@ -287,8 +287,8 @@ import (
"log/slog"
"net/http"

"github.com/go-spring-projects/go-spring/dync"
"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/dync"
"go-spring.dev/spring/gs"
)

type Handler struct {
Expand Down Expand Up @@ -373,7 +373,7 @@ import (
"os"
"strings"

"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/gs"
)

func init() {
Expand Down Expand Up @@ -531,8 +531,8 @@ import (
"os"
"strings"

"github.com/go-spring-projects/go-spring/gs"
"github.com/urfave/cli/v2"
"go-spring.dev/spring/gs"
)

//import _ "testapp/pkg/infra"
Expand Down
22 changes: 11 additions & 11 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

[![GoDoc][1]][2] [![Build Status][7]][8] [![Codecov][9]][10] [![Release][5]][6] [![license-Apache 2][3]][4]

[1]: https://godoc.org/github.com/go-spring-projects/go-spring?status.svg
[2]: https://godoc.org/github.com/go-spring-projects/go-spring
[1]: https://godoc.org/go-spring.dev/spring?status.svg
[2]: https://godoc.org/go-spring.dev/spring
[3]: https://img.shields.io/badge/license-Apache%202-blue.svg
[4]: LICENSE
[5]: https://img.shields.io/github/v/release/go-spring-projects/go-spring?color=orange
Expand All @@ -22,7 +22,7 @@
[English](README.md) | 中文

### 安装
`go get github.com/go-spring-projects/go-spring@latest`
`go get go-spring.dev/spring@latest`

### 主要特性
* **IoC容器**: 实现了基于反射的控制反转(IoC)容器,支持结构体、函数和常量的注入。这意味着你可以使用`autowired`标签来自动注入依赖,而不必手动管理它们。
Expand Down Expand Up @@ -69,7 +69,7 @@ import (
"context"
"log/slog"

"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/gs"
)

type MyApp struct {
Expand Down Expand Up @@ -98,7 +98,7 @@ func main() {
```go
package mypkg

import "github.com/go-spring-projects/go-spring/gs"
import "go-spring.dev/spring/gs"

type MyApp struct {}

Expand Down Expand Up @@ -208,8 +208,8 @@ import (
"fmt"
"log/slog"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/gs"
"gopkg.in/validator.v2"
)

Expand Down Expand Up @@ -286,8 +286,8 @@ import (
"log/slog"
"net/http"

"github.com/go-spring-projects/go-spring/dync"
"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/dync"
"go-spring.dev/spring/gs"
)

type Handler struct {
Expand Down Expand Up @@ -372,7 +372,7 @@ import (
"os"
"strings"

"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/gs"
)

func init() {
Expand Down Expand Up @@ -530,7 +530,7 @@ import (
"os"
"strings"

"github.com/go-spring-projects/go-spring/gs"
"go-spring.dev/spring/gs"
"github.com/urfave/cli/v2"
)

Expand Down
2 changes: 1 addition & 1 deletion conf/bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import (
"strconv"
"strings"

"github.com/go-spring-projects/go-spring/internal/utils"
"go-spring.dev/spring/internal/utils"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion conf/bind_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"testing"
"time"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

type Point struct {
Expand Down
10 changes: 5 additions & 5 deletions conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ import (
"strings"
"time"

"github.com/go-spring-projects/go-spring/conf/internal"
"github.com/go-spring-projects/go-spring/conf/prop"
"github.com/go-spring-projects/go-spring/conf/toml"
"github.com/go-spring-projects/go-spring/conf/yaml"
"github.com/go-spring-projects/go-spring/internal/utils"
"github.com/spf13/cast"
"go-spring.dev/spring/conf/internal"
"go-spring.dev/spring/conf/prop"
"go-spring.dev/spring/conf/toml"
"go-spring.dev/spring/conf/yaml"
"go-spring.dev/spring/internal/utils"
)

// Splitter splits string into []string by some characters.
Expand Down
2 changes: 1 addition & 1 deletion conf/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package conf
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestRegisterConverter(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/flat_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package conf
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestFlatten(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/internal/path_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestSplitPath(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/internal/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"fmt"
"sort"

"github.com/go-spring-projects/go-spring/internal/utils"
"go-spring.dev/spring/internal/utils"
)

type nodeType int
Expand Down
2 changes: 1 addition & 1 deletion conf/internal/storage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package internal
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestStorage(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/prop/prop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package prop
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestRead(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/toml/toml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package toml
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestRead(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion conf/validate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package conf
import (
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

var empty = &emptyValidator{}
Expand Down
2 changes: 1 addition & 1 deletion conf/yaml/yaml_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"strings"
"testing"

"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/internal/utils/assert"
)

func TestRead(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dync/array.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"encoding/json"
"sync/atomic"

"github.com/go-spring-projects/go-spring/conf"
"go-spring.dev/spring/conf"
)

var _ conf.Value = (*Array[any])(nil)
Expand Down
4 changes: 2 additions & 2 deletions dync/array_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"encoding/json"
"testing"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

func TestArray(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dync/bool.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"encoding/json"
"sync/atomic"

"github.com/go-spring-projects/go-spring/conf"
"go-spring.dev/spring/conf"
)

var _ conf.Value = (*Bool)(nil)
Expand Down
4 changes: 2 additions & 2 deletions dync/bool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"encoding/json"
"testing"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

func TestBool(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dync/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"sync/atomic"
"time"

"github.com/go-spring-projects/go-spring/conf"
"go-spring.dev/spring/conf"
)

var _ conf.Value = (*Duration)(nil)
Expand Down
4 changes: 2 additions & 2 deletions dync/duration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"testing"
"time"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

func TestDuration(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions dync/dync.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import (
"strings"
"sync/atomic"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils"
)

// A Field represents a refreshable struct field.
Expand Down
4 changes: 2 additions & 2 deletions dync/dync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import (
"reflect"
"testing"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

func TestProperties(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dync/float32.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"math"
"sync/atomic"

"github.com/go-spring-projects/go-spring/conf"
"go-spring.dev/spring/conf"
)

var _ conf.Value = (*Float32)(nil)
Expand Down
4 changes: 2 additions & 2 deletions dync/float32_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"encoding/json"
"testing"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

func TestFloat32(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion dync/float64.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"math"
"sync/atomic"

"github.com/go-spring-projects/go-spring/conf"
"go-spring.dev/spring/conf"
)

var _ conf.Value = (*Float64)(nil)
Expand Down
4 changes: 2 additions & 2 deletions dync/float64_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import (
"encoding/json"
"testing"

"github.com/go-spring-projects/go-spring/conf"
"github.com/go-spring-projects/go-spring/internal/utils/assert"
"go-spring.dev/spring/conf"
"go-spring.dev/spring/internal/utils/assert"
)

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