Skip to content

Commit

Permalink
chore: v2
Browse files Browse the repository at this point in the history
  • Loading branch information
caixw committed Apr 29, 2024
1 parent 61a1dd4 commit afa700e
Show file tree
Hide file tree
Showing 14 changed files with 20 additions and 20 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Test](https://github.com/issue9/cnregion/workflows/Test/badge.svg)](https://github.com/issue9/cnregion/actions?query=workflow%3ATest)
[![Go version](https://img.shields.io/github/go-mod/go-version/issue9/cnregion)](https://golang.org)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/issue9/cnregion)](https://pkg.go.dev/github.com/issue9/cnregion)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/issue9/cnregion)](https://pkg.go.dev/github.com/issue9/cnregion/v2)
[![codecov](https://codecov.io/gh/issue9/cnregion/branch/master/graph/badge.svg)](https://codecov.io/gh/issue9/cnregion)
![License](https://img.shields.io/github/license/issue9/cnregion)

Expand Down Expand Up @@ -31,7 +31,7 @@ list := v.Search(&SearchOptions{Text: "温州"}) // 按索地名中带温州的
## 安装

```shell
go get github.com/issue9/cnregion
go get github.com/issue9/cnregion/v2
```

## 版权
Expand Down
4 changes: 2 additions & 2 deletions cmd/fetch/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"strconv"
"strings"

"github.com/issue9/cnregion"
"github.com/issue9/cnregion/version"
"github.com/issue9/cnregion/v2"
"github.com/issue9/cnregion/v2/version"
)

func build(dataDir, output string, years ...int) error {
Expand Down
2 changes: 1 addition & 1 deletion cmd/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
"time"

"github.com/gocolly/colly/v2"
"github.com/issue9/cnregion/version"
"github.com/issue9/cnregion/v2/version"
"github.com/issue9/term/v3/colors"
)

Expand Down
4 changes: 2 additions & 2 deletions cmd/fetch/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.22.0
require (
github.com/gocolly/colly/v2 v2.1.0
github.com/issue9/cmdopt v0.13.1
github.com/issue9/cnregion v1.2023.2
github.com/issue9/cnregion/v2 v2.2023.0
github.com/issue9/errwrap v0.3.2
github.com/issue9/sliceutil v0.16.1
github.com/issue9/term/v3 v3.2.8
Expand All @@ -30,4 +30,4 @@ require (
google.golang.org/protobuf v1.28.1 // indirect
)

replace github.com/issue9/cnregion => ../../
replace github.com/issue9/cnregion/v2 => ../../
4 changes: 2 additions & 2 deletions cnregion_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import (

"github.com/issue9/assert/v4"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/version"
"github.com/issue9/cnregion/v2/id"
"github.com/issue9/cnregion/v2/version"
)

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

"github.com/issue9/cnregion"
"github.com/issue9/cnregion/v2"
)

//go:embed regions.db
Expand Down
2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (

"github.com/issue9/errwrap"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/v2/id"
)

// Version 数据文件的版本号
Expand Down
4 changes: 2 additions & 2 deletions db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (

"github.com/issue9/assert/v4"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/version"
"github.com/issue9/cnregion/v2/id"
"github.com/issue9/cnregion/v2/version"
)

var data = []byte(`1:[2020,2019]:::1:2{33:浙江:1:1{01:温州:3:0{}}34:安徽:1:3{01:合肥:3:0{}02:芜湖:1:0{}03:芜湖-2:1:0{}}}`)
Expand Down
2 changes: 1 addition & 1 deletion districts.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package cnregion

import "github.com/issue9/cnregion/id"
import "github.com/issue9/cnregion/v2/id"

// Districts 按行政大区划分
//
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 github.com/issue9/cnregion
module github.com/issue9/cnregion/v2

go 1.17

Expand Down
2 changes: 1 addition & 1 deletion region.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/issue9/errwrap"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/v2/id"
)

// Region 表示单个区域
Expand Down
2 changes: 1 addition & 1 deletion region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/issue9/assert/v4"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/v2/id"
)

func TestRegion_IsSupported(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions search.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package cnregion
import (
"strings"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/v2/id"
)

// Options 搜索选项
Expand All @@ -25,7 +25,7 @@ type Options struct {

// 搜索的城市类型
//
// 该值取值于 github.com/issue9/cnregion/id.Level 类型。 多个值可以通过或运算叠加。
// 该值取值于 github.com/issue9/cnregion/v2/id.Level 类型。 多个值可以通过或运算叠加。
// 0 表示所有类型。
Level id.Level

Expand Down
2 changes: 1 addition & 1 deletion search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

"github.com/issue9/assert/v4"

"github.com/issue9/cnregion/id"
"github.com/issue9/cnregion/v2/id"
)

func TestDB_Search(t *testing.T) {
Expand Down

0 comments on commit afa700e

Please sign in to comment.