From afa700e15065ac572442d93d6be7faeff78dd4cc Mon Sep 17 00:00:00 2001 From: caixw Date: Mon, 29 Apr 2024 13:30:02 +0800 Subject: [PATCH] chore: v2 --- README.md | 4 ++-- cmd/fetch/build.go | 4 ++-- cmd/fetch/fetch.go | 2 +- cmd/fetch/go.mod | 4 ++-- cnregion_test.go | 4 ++-- data/embed.go | 2 +- db.go | 2 +- db_test.go | 4 ++-- districts.go | 2 +- go.mod | 2 +- region.go | 2 +- region_test.go | 2 +- search.go | 4 ++-- search_test.go | 2 +- 14 files changed, 20 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 487e532..87d84a8 100644 --- a/README.md +++ b/README.md @@ -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) @@ -31,7 +31,7 @@ list := v.Search(&SearchOptions{Text: "温州"}) // 按索地名中带温州的 ## 安装 ```shell -go get github.com/issue9/cnregion +go get github.com/issue9/cnregion/v2 ``` ## 版权 diff --git a/cmd/fetch/build.go b/cmd/fetch/build.go index ff52d19..dd19fac 100644 --- a/cmd/fetch/build.go +++ b/cmd/fetch/build.go @@ -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 { diff --git a/cmd/fetch/fetch.go b/cmd/fetch/fetch.go index bc81411..233eaba 100644 --- a/cmd/fetch/fetch.go +++ b/cmd/fetch/fetch.go @@ -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" ) diff --git a/cmd/fetch/go.mod b/cmd/fetch/go.mod index 2d311fa..f632f75 100644 --- a/cmd/fetch/go.mod +++ b/cmd/fetch/go.mod @@ -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 @@ -30,4 +30,4 @@ require ( google.golang.org/protobuf v1.28.1 // indirect ) -replace github.com/issue9/cnregion => ../../ +replace github.com/issue9/cnregion/v2 => ../../ diff --git a/cnregion_test.go b/cnregion_test.go index 98939d0..4a270f9 100644 --- a/cnregion_test.go +++ b/cnregion_test.go @@ -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) { diff --git a/data/embed.go b/data/embed.go index 71ef8db..058bf31 100644 --- a/data/embed.go +++ b/data/embed.go @@ -7,7 +7,7 @@ package data import ( "embed" - "github.com/issue9/cnregion" + "github.com/issue9/cnregion/v2" ) //go:embed regions.db diff --git a/db.go b/db.go index d1b6e59..6c25239 100644 --- a/db.go +++ b/db.go @@ -13,7 +13,7 @@ import ( "github.com/issue9/errwrap" - "github.com/issue9/cnregion/id" + "github.com/issue9/cnregion/v2/id" ) // Version 数据文件的版本号 diff --git a/db_test.go b/db_test.go index fb54592..bfe7bf6 100644 --- a/db_test.go +++ b/db_test.go @@ -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{}}}`) diff --git a/districts.go b/districts.go index bd68437..d790e31 100644 --- a/districts.go +++ b/districts.go @@ -4,7 +4,7 @@ package cnregion -import "github.com/issue9/cnregion/id" +import "github.com/issue9/cnregion/v2/id" // Districts 按行政大区划分 // diff --git a/go.mod b/go.mod index 1f1ec47..d615fb8 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/issue9/cnregion +module github.com/issue9/cnregion/v2 go 1.17 diff --git a/region.go b/region.go index aecdbe3..9eedac8 100644 --- a/region.go +++ b/region.go @@ -12,7 +12,7 @@ import ( "github.com/issue9/errwrap" - "github.com/issue9/cnregion/id" + "github.com/issue9/cnregion/v2/id" ) // Region 表示单个区域 diff --git a/region_test.go b/region_test.go index fa732b0..11bbc01 100644 --- a/region_test.go +++ b/region_test.go @@ -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) { diff --git a/search.go b/search.go index f2151f5..d2f0fc9 100644 --- a/search.go +++ b/search.go @@ -7,7 +7,7 @@ package cnregion import ( "strings" - "github.com/issue9/cnregion/id" + "github.com/issue9/cnregion/v2/id" ) // Options 搜索选项 @@ -25,7 +25,7 @@ type Options struct { // 搜索的城市类型 // - // 该值取值于 github.com/issue9/cnregion/id.Level 类型。 多个值可以通过或运算叠加。 + // 该值取值于 github.com/issue9/cnregion/v2/id.Level 类型。 多个值可以通过或运算叠加。 // 0 表示所有类型。 Level id.Level diff --git a/search_test.go b/search_test.go index efd9428..35abb48 100644 --- a/search_test.go +++ b/search_test.go @@ -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) {