Skip to content

Commit

Permalink
修改包结构,使其可以被引用为go module
Browse files Browse the repository at this point in the history
  • Loading branch information
baletu committed Apr 10, 2023
1 parent 6ca3464 commit a450c0d
Show file tree
Hide file tree
Showing 37 changed files with 70 additions and 70 deletions.
10 changes: 5 additions & 5 deletions core/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package core
import (
"context"
"fmt"
"gofound/global"
"gofound/searcher"
"gofound/searcher/words"
"gofound/web/controller"
"gofound/web/router"
"github.com/sea-team/gofound/global"
"github.com/sea-team/gofound/searcher"
"github.com/sea-team/gofound/searcher/words"
"github.com/sea-team/gofound/web/controller"
"github.com/sea-team/gofound/web/router"
"log"
"net/http"

Expand Down
2 changes: 1 addition & 1 deletion core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package core
import (
"flag"
"fmt"
"gofound/global"
"github.com/sea-team/gofound/global"
"os"
"runtime"

Expand Down
2 changes: 1 addition & 1 deletion docs/compile.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

`gofound` 基于`golang-1.18`,编译之前需要安装对于的golang版本。

推荐使用编译好的[二进制文件](https://github.com/newpanjing/gofound/releases)
推荐使用编译好的[二进制文件](https://github.com/newpanjing/github.com/sea-team/gofound/releases)

## Admin
> 如果需要Admin部分,请先构建admin,admin基于vue+element-ui+vite,而这些也需要安装nodejs
Expand Down
2 changes: 1 addition & 1 deletion docs/example.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# 示例

编译好的下载地址:
[https://github.com/newpanjing/gofound/releases](https://github.com/newpanjing/gofound/releases)
[https://github.com/newpanjing/github.com/sea-team/gofound/releases](https://github.com/newpanjing/github.com/sea-team/gofound/releases)

将编译后的`gofound`文件复制到`/usr/local/bin`目录下,然后在命令行中运行`gofound`命令即可。

Expand Down
2 changes: 1 addition & 1 deletion global/global.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package global

import (
"gofound/searcher"
"github.com/sea-team/gofound/searcher"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"gofound/core"
"github.com/sea-team/gofound/core"
)

func main() {
Expand Down
4 changes: 2 additions & 2 deletions sdk/base.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package gofound

import (
"gofound/searcher/model"
"gofound/searcher/system"
"github.com/sea-team/gofound/searcher/model"
"github.com/sea-team/gofound/searcher/system"
"runtime"
)

Expand Down
6 changes: 3 additions & 3 deletions sdk/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package gofound

import (
"fmt"
"gofound/core"
"gofound/global"
"gofound/searcher"
"github.com/sea-team/gofound/core"
"github.com/sea-team/gofound/global"
"github.com/sea-team/gofound/searcher"
"os"
"runtime"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion sdk/database.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package gofound

import (
"gofound/searcher"
"github.com/sea-team/gofound/searcher"

"github.com/syndtr/goleveldb/leveldb/errors"
)
Expand Down
2 changes: 1 addition & 1 deletion sdk/index.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package gofound

import (
"errors"
"gofound/searcher/model"
"github.com/sea-team/gofound/searcher/model"
)

// AddIndex 添加索引
Expand Down
2 changes: 1 addition & 1 deletion searcher/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package searcher
import (
"errors"
"fmt"
"gofound/searcher/words"
"github.com/sea-team/gofound/searcher/words"
"log"
"os"
"runtime"
Expand Down
2 changes: 1 addition & 1 deletion searcher/container_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

func TestContainer_Init(t *testing.T) {
c := &Container{
Dir: "/Users/panjing/GolandProjects/gofound/dbs",
Dir: "/Users/panjing/GolandProjects/github.com/sea-team/gofound/dbs",
Debug: true,
}
err := c.Init()
Expand Down
14 changes: 7 additions & 7 deletions searcher/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package searcher

import (
"fmt"
"gofound/searcher/arrays"
"gofound/searcher/model"
"gofound/searcher/pagination"
"gofound/searcher/sorts"
"gofound/searcher/storage"
"gofound/searcher/utils"
"gofound/searcher/words"
"github.com/sea-team/gofound/searcher/arrays"
"github.com/sea-team/gofound/searcher/model"
"github.com/sea-team/gofound/searcher/pagination"
"github.com/sea-team/gofound/searcher/sorts"
"github.com/sea-team/gofound/searcher/storage"
"github.com/sea-team/gofound/searcher/utils"
"github.com/sea-team/gofound/searcher/words"
"log"
"os"
"runtime"
Expand Down
2 changes: 1 addition & 1 deletion searcher/sorts/fast.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package sorts

import (
"gofound/searcher/model"
"github.com/sea-team/gofound/searcher/model"
"sort"
"strings"
"sync"
Expand Down
2 changes: 1 addition & 1 deletion searcher/sorts/sort.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package sorts

import (
"github.com/emirpasic/gods/trees/avltree"
"gofound/searcher/utils"
"github.com/sea-team/gofound/searcher/utils"
"log"
"sync"
)
Expand Down
2 changes: 1 addition & 1 deletion searcher/storage/leveldb_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

func TestLeveldb(t *testing.T) {
db, err := leveldb.OpenFile("/Users/panjing/GolandProjects/gofound/cache/doc_6.db", nil)
db, err := leveldb.OpenFile("/Users/panjing/GolandProjects/github.com/sea-team/gofound/cache/doc_6.db", nil)
if err != nil {
t.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion searcher/words/tokenizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package words

import (
"embed"
"gofound/searcher/utils"
"github.com/sea-team/gofound/searcher/utils"
"strings"

"github.com/wangbin/jiebago"
Expand Down
2 changes: 1 addition & 1 deletion tests/benchmark/array_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package benchmark

import (
"gofound/searcher/arrays"
"github.com/sea-team/gofound/searcher/arrays"
"testing"
)

Expand Down
2 changes: 1 addition & 1 deletion tests/benchmark/skiplist_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package benchmark

import (
"gofound/searcher/arrays"
"github.com/sea-team/gofound/searcher/arrays"
"math/rand"
"testing"
)
Expand Down
8 changes: 4 additions & 4 deletions tests/index_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package tests
import (
"bufio"
"fmt"
"gofound/searcher"
"gofound/searcher/model"
"gofound/searcher/utils"
"gofound/searcher/words"
"github.com/sea-team/gofound/searcher"
"github.com/sea-team/gofound/searcher/model"
"github.com/sea-team/gofound/searcher/utils"
"github.com/sea-team/gofound/searcher/words"
"os"
"strings"
"testing"
Expand Down
12 changes: 6 additions & 6 deletions tests/sort_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package tests

import (
"fmt"
"gofound/searcher/utils"
"github.com/sea-team/gofound/searcher/utils"
"math/rand"
"sort"
"testing"
)

//排序测试

//冒泡排序测试
// 冒泡排序测试
func TestSort(t *testing.T) {
//测试数据
var data []int
Expand Down Expand Up @@ -63,7 +63,7 @@ func TestSort(t *testing.T) {

}

//冒泡排序
// 冒泡排序
func BubbleSort(data []int) {
//排序
for i := 0; i < len(data)-1; i++ {
Expand Down Expand Up @@ -94,7 +94,7 @@ func SelectSort(arr []int) {
}
}

//快速排序
// 快速排序
func QuickSort(arr []int, start, end int) {
if start < end {
i, j := start, end
Expand Down Expand Up @@ -165,7 +165,7 @@ func TestFastSort(t *testing.T) {

}

//获取数组最大值
// 获取数组最大值
func getMaxInArr(arr []int) int {
max := arr[0]
for i := 1; i < len(arr); i++ {
Expand All @@ -192,7 +192,7 @@ func sortInBucket(bucket []int) { //此处实现插入排序方式,其实可
}
}

//桶排序
// 桶排序
func BucketSort(arr []int) []int {
//桶数
num := len(arr)
Expand Down
2 changes: 1 addition & 1 deletion tests/word_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
func TestWord(t *testing.T) {
var seg jiebago.Segmenter

seg.LoadDictionary("/Users/panjing/GolandProjects/gofound/data/dictionary.txt")
seg.LoadDictionary("/Users/panjing/GolandProjects/github.com/sea-team/gofound/data/dictionary.txt")
r := seg.CutForSearch("想在西安买房投资,哪个区域比较好,最好有具体楼盘?", true)
words := make([]string, 0)
for {
Expand Down
2 changes: 1 addition & 1 deletion web/admin/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package admin

import (
"github.com/gin-gonic/gin"
"gofound/web/admin/assets"
"github.com/sea-team/gofound/web/admin/assets"
"net/http"
"net/url"
"os"
Expand Down
2 changes: 1 addition & 1 deletion web/controller/base.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package controller

import (
"gofound/searcher/model"
"github.com/sea-team/gofound/searcher/model"

"github.com/gin-gonic/gin"
)
Expand Down
2 changes: 1 addition & 1 deletion web/controller/index.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package controller

import (
"gofound/searcher/model"
"github.com/sea-team/gofound/searcher/model"

"github.com/gin-gonic/gin"
)
Expand Down
2 changes: 1 addition & 1 deletion web/controller/services.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package controller

import (
service2 "gofound/web/service"
service2 "github.com/sea-team/gofound/web/service"
)

var srv *Services
Expand Down
2 changes: 1 addition & 1 deletion web/middleware/exception.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package middleware

import (
"gofound/web"
"github.com/sea-team/gofound/web"
"runtime/debug"

"github.com/gin-gonic/gin"
Expand Down
2 changes: 1 addition & 1 deletion web/router/base.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package router

import (
"gofound/web/controller"
"github.com/sea-team/gofound/web/controller"

"github.com/gin-gonic/gin"
)
Expand Down
2 changes: 1 addition & 1 deletion web/router/database.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package router

import (
"gofound/web/controller"
"github.com/sea-team/gofound/web/controller"

"github.com/gin-gonic/gin"
)
Expand Down
2 changes: 1 addition & 1 deletion web/router/index.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package router

import (
"gofound/web/controller"
"github.com/sea-team/gofound/web/controller"

"github.com/gin-gonic/gin"
)
Expand Down
6 changes: 3 additions & 3 deletions web/router/router.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package router

import (
"gofound/global"
"gofound/web/admin"
"gofound/web/middleware"
"github.com/sea-team/gofound/global"
"github.com/sea-team/gofound/web/admin"
"github.com/sea-team/gofound/web/middleware"
"io"
"log"
"mime"
Expand Down
2 changes: 1 addition & 1 deletion web/router/word.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package router

import (
"gofound/web/controller"
"github.com/sea-team/gofound/web/controller"

"github.com/gin-gonic/gin"
)
Expand Down
8 changes: 4 additions & 4 deletions web/service/base.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package service

import (
"gofound/global"
"gofound/searcher"
"gofound/searcher/model"
"gofound/searcher/system"
"github.com/sea-team/gofound/global"
"github.com/sea-team/gofound/searcher"
"github.com/sea-team/gofound/searcher/model"
"github.com/sea-team/gofound/searcher/system"
"os"
"runtime"
)
Expand Down
4 changes: 2 additions & 2 deletions web/service/database.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package service

import (
"gofound/global"
"gofound/searcher"
"github.com/sea-team/gofound/global"
"github.com/sea-team/gofound/searcher"
)

type Database struct {
Expand Down
Loading

0 comments on commit a450c0d

Please sign in to comment.