Skip to content
This repository has been archived by the owner on Sep 20, 2022. It is now read-only.

Commit

Permalink
fix: changed module path
Browse files Browse the repository at this point in the history
  • Loading branch information
johan-lejdung committed Aug 23, 2022
1 parent 3e08de4 commit 30e39b4
Show file tree
Hide file tree
Showing 87 changed files with 158 additions and 159 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
export PATH=$PATH:$(go env GOPATH)/bin # https://github.com/actions/setup-go/issues/14
mkdir -p $(go env GOPATH)/src/github.com/swaggo
ln -s $(pwd) $(go env GOPATH)/src/github.com/swaggo/swag
ln -s $(pwd) $(go env GOPATH)/src/github.com/chaintraced/swag
make fmt-check lint vet
env:
GOPATH: ${{ runner.workspace }}
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Expand Up @@ -13,7 +13,7 @@ GOPATH:=$(shell $(GOCMD) env GOPATH)
u := $(if $(update),-u)

BINARY_NAME:=swag
PACKAGES:=$(shell $(GOLIST) github.com/swaggo/swag github.com/swaggo/swag/cmd/swag github.com/swaggo/swag/gen github.com/swaggo/swag/format)
PACKAGES:=$(shell $(GOLIST) github.com/chaintraced/swag github.com/chaintraced/swag/cmd/swag github.com/chaintraced/swag/gen github.com/chaintraced/swag/format)
GOFILES:=$(shell find . -name "*.go" -type f)

export GO111MODULE := on
Expand Down
2 changes: 1 addition & 1 deletion PULL_REQUEST_TEMPLATE.md
Expand Up @@ -2,7 +2,7 @@
e.g. add cool parser.

**Relation issue**
e.g. https://github.com/swaggo/swag/pull/118/files
e.g. https://github.com/chaintraced/swag/pull/118/files

**Additional context**
Add any other context about the problem here.
40 changes: 20 additions & 20 deletions README.md
Expand Up @@ -4,14 +4,14 @@

<img align="right" width="180px" src="https://raw.githubusercontent.com/swaggo/swag/master/assets/swaggo.png">

[![Build Status](https://github.com/swaggo/swag/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/features/actions)
[![Build Status](https://github.com/chaintraced/swag/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/features/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/swaggo/swag/master.svg)](https://codecov.io/gh/swaggo/swag)
[![Go Report Card](https://goreportcard.com/badge/github.com/swaggo/swag)](https://goreportcard.com/report/github.com/swaggo/swag)
[![Go Report Card](https://goreportcard.com/badge/github.com/chaintraced/swag)](https://goreportcard.com/report/github.com/chaintraced/swag)
[![codebeat badge](https://codebeat.co/badges/71e2f5e5-9e6b-405d-baf9-7cc8b5037330)](https://codebeat.co/projects/github-com-swaggo-swag-master)
[![Go Doc](https://godoc.org/github.com/swaggo/swagg?status.svg)](https://godoc.org/github.com/swaggo/swag)
[![Go Doc](https://godoc.org/github.com/chaintraced/swagg?status.svg)](https://godoc.org/github.com/chaintraced/swag)
[![Backers on Open Collective](https://opencollective.com/swag/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/swag/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fswaggo%2Fswag.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fswaggo%2Fswag?ref=badge_shield)
[![Release](https://img.shields.io/github/release/swaggo/swag.svg?style=flat-square)](https://github.com/swaggo/swag/releases)
[![Release](https://img.shields.io/github/release/swaggo/swag.svg?style=flat-square)](https://github.com/chaintraced/swag/releases)


Swag converts Go annotations to Swagger Documentation 2.0. We've created a variety of plugins for popular [Go web frameworks](#supported-web-frameworks). This allows you to quickly integrate with an existing Go project (using Swagger UI).
Expand Down Expand Up @@ -52,14 +52,14 @@ Swag converts Go annotations to Swagger Documentation 2.0. We've created a varie

2. Download swag by using:
```sh
$ go get -u github.com/swaggo/swag/cmd/swag
$ go get -u github.com/chaintraced/swag/cmd/swag

# 1.16 or newer
$ go install github.com/swaggo/swag/cmd/swag@latest
$ go install github.com/chaintraced/swag/cmd/swag@latest
```
To build from source you need [Go](https://golang.org/dl/) (1.15 or newer).

Or download a pre-compiled binary from the [release page](https://github.com/swaggo/swag/releases).
Or download a pre-compiled binary from the [release page](https://github.com/chaintraced/swag/releases).

3. Run `swag init` in the project's root folder which contains the `main.go` file. This will parse your comments and generate the required files (`docs` folder and `docs/docs.go`).
```sh
Expand Down Expand Up @@ -137,7 +137,7 @@ OPTIONS:

## How to use it with Gin

Find the example source code [here](https://github.com/swaggo/swag/tree/master/example/celler).
Find the example source code [here](https://github.com/chaintraced/swag/tree/master/example/celler).

1. After using `swag init` to generate Swagger 2.0 docs, import the following packages:
```go
Expand Down Expand Up @@ -237,8 +237,8 @@ import (
"strconv"

"github.com/gin-gonic/gin"
"github.com/swaggo/swag/example/celler/httputil"
"github.com/swaggo/swag/example/celler/model"
"github.com/chaintraced/swag/example/celler/httputil"
"github.com/chaintraced/swag/example/celler/model"
)

// ShowAccount godoc
Expand Down Expand Up @@ -303,7 +303,7 @@ $ swag init
## The swag formatter

The Swag Comments can be automatically formatted, just like 'go fmt'.
Find the result of formatting [here](https://github.com/swaggo/swag/tree/master/example/celler).
Find the result of formatting [here](https://github.com/chaintraced/swag/tree/master/example/celler).

Usage:
```shell
Expand Down Expand Up @@ -340,7 +340,7 @@ swag fmt -d ./ --exclude ./internal
## General API Info

**Example**
[celler/main.go](https://github.com/swaggo/swag/blob/master/example/celler/main.go)
[celler/main.go](https://github.com/chaintraced/swag/blob/master/example/celler/main.go)

| annotation | description | example |
|-------------|--------------------------------------------|---------------------------------|
Expand Down Expand Up @@ -381,7 +381,7 @@ When a short string in your documentation is insufficient, or you need images, c
## API Operation

**Example**
[celler/controller](https://github.com/swaggo/swag/tree/master/example/celler/controller)
[celler/controller](https://github.com/chaintraced/swag/tree/master/example/celler/controller)


| annotation | description |
Expand Down Expand Up @@ -544,20 +544,20 @@ type Account struct {

### Function scoped struct declaration

You can declare your request response structs inside a function body.
You can declare your request response structs inside a function body.
You must have to follow the naming convention `<package-name>.<function-name>.<struct-name> `.

```go
package main

// @Param request body main.MyHandler.request true "query params"
// @Param request body main.MyHandler.request true "query params"
// @Success 200 {object} main.MyHandler.response
// @Router /test [post]
func MyHandler() {
type request struct {
RequestField string
}

type response struct {
ResponseField string
}
Expand Down Expand Up @@ -663,7 +663,7 @@ type Account struct {
}
```

[#708](https://github.com/swaggo/swag/issues/708) The parser handles only struct comments starting with `@Description` attribute.
[#708](https://github.com/chaintraced/swag/issues/708) The parser handles only struct comments starting with `@Description` attribute.
But it writes all struct field comments as is.

So, generated swagger doc as follows:
Expand All @@ -685,7 +685,7 @@ So, generated swagger doc as follows:
```

### Use swaggertype tag to supported custom type
[#201](https://github.com/swaggo/swag/issues/201#issuecomment-475479409)
[#201](https://github.com/chaintraced/swag/issues/201#issuecomment-475479409)

```go
type TimestampTime struct {
Expand Down Expand Up @@ -721,7 +721,7 @@ type Account struct {
}
```

[#379](https://github.com/swaggo/swag/issues/379)
[#379](https://github.com/chaintraced/swag/issues/379)
```go
type CerticateKeyPair struct {
Crt []byte `json:"crt" swaggertype:"string" format:"base64" example:"U3dhZ2dlciByb2Nrcw=="`
Expand Down Expand Up @@ -883,7 +883,7 @@ This project was inspired by [yvasiyarov/swagger](https://github.com/yvasiyarov/
## Contributors

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/swaggo/swag/graphs/contributors"><img src="https://opencollective.com/swag/contributors.svg?width=890&button=false" /></a>
<a href="https://github.com/chaintraced/swag/graphs/contributors"><img src="https://opencollective.com/swag/contributors.svg?width=890&button=false" /></a>


## Backers
Expand Down
32 changes: 16 additions & 16 deletions README_zh-CN.md
Expand Up @@ -6,12 +6,12 @@

[![Travis Status](https://img.shields.io/travis/swaggo/swag/master.svg)](https://travis-ci.org/swaggo/swag)
[![Coverage Status](https://img.shields.io/codecov/c/github/swaggo/swag/master.svg)](https://codecov.io/gh/swaggo/swag)
[![Go Report Card](https://goreportcard.com/badge/github.com/swaggo/swag)](https://goreportcard.com/report/github.com/swaggo/swag)
[![Go Report Card](https://goreportcard.com/badge/github.com/chaintraced/swag)](https://goreportcard.com/report/github.com/chaintraced/swag)
[![codebeat badge](https://codebeat.co/badges/71e2f5e5-9e6b-405d-baf9-7cc8b5037330)](https://codebeat.co/projects/github-com-swaggo-swag-master)
[![Go Doc](https://godoc.org/github.com/swaggo/swagg?status.svg)](https://godoc.org/github.com/swaggo/swag)
[![Backers on Open Collective](https://opencollective.com/swag/backers/badge.svg)](#backers)
[![Go Doc](https://godoc.org/github.com/chaintraced/swagg?status.svg)](https://godoc.org/github.com/chaintraced/swag)
[![Backers on Open Collective](https://opencollective.com/swag/backers/badge.svg)](#backers)
[![Sponsors on Open Collective](https://opencollective.com/swag/sponsors/badge.svg)](#sponsors) [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fswaggo%2Fswag.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fswaggo%2Fswag?ref=badge_shield)
[![Release](https://img.shields.io/github/release/swaggo/swag.svg?style=flat-square)](https://github.com/swaggo/swag/releases)
[![Release](https://img.shields.io/github/release/swaggo/swag.svg?style=flat-square)](https://github.com/chaintraced/swag/releases)

Swag将Go的注释转换为Swagger2.0文档。我们为流行的 [Go Web Framework](#支持的Web框架) 创建了各种插件,这样可以与现有Go项目快速集成(使用Swagger UI)。

Expand Down Expand Up @@ -47,10 +47,10 @@ Swag将Go的注释转换为Swagger2.0文档。我们为流行的 [Go Web Framewo
2. 使用如下命令下载swag:

```bash
$ go get -u github.com/swaggo/swag/cmd/swag
$ go get -u github.com/chaintraced/swag/cmd/swag

# 1.16 及以上版本
$ go install github.com/swaggo/swag/cmd/swag@latest
$ go install github.com/chaintraced/swag/cmd/swag@latest
```

从源码开始构建的话,需要有Go环境(1.15及以上版本)。
Expand Down Expand Up @@ -132,7 +132,7 @@ OPTIONS:

## 如何与Gin集成

[点击此处](https://github.com/swaggo/swag/tree/master/example/celler)查看示例源代码。
[点击此处](https://github.com/chaintraced/swag/tree/master/example/celler)查看示例源代码。

1. 使用`swag init`生成Swagger2.0文档后,导入如下代码包:

Expand Down Expand Up @@ -233,8 +233,8 @@ import (
"strconv"

"github.com/gin-gonic/gin"
"github.com/swaggo/swag/example/celler/httputil"
"github.com/swaggo/swag/example/celler/model"
"github.com/chaintraced/swag/example/celler/httputil"
"github.com/chaintraced/swag/example/celler/model"
)

// ShowAccount godoc
Expand Down Expand Up @@ -298,8 +298,8 @@ swag init

## 格式化说明

可以针对Swag的注释自动格式化,就像`go fmt`
此处查看格式化结果 [here](https://github.com/swaggo/swag/tree/master/example/celler).
可以针对Swag的注释自动格式化,就像`go fmt`
此处查看格式化结果 [here](https://github.com/chaintraced/swag/tree/master/example/celler).

示例:
```shell
Expand Down Expand Up @@ -335,7 +335,7 @@ swag fmt -d ./ --exclude ./internal

## 通用API信息

**示例** [`celler/main.go`](https://github.com/swaggo/swag/blob/master/example/celler/main.go)
**示例** [`celler/main.go`](https://github.com/chaintraced/swag/blob/master/example/celler/main.go)

| 注释 | 说明 | 示例 |
| ----------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------- |
Expand Down Expand Up @@ -374,7 +374,7 @@ swag fmt -d ./ --exclude ./internal

## API操作

Example [celler/controller](https://github.com/swaggo/swag/tree/master/example/celler/controller)
Example [celler/controller](https://github.com/chaintraced/swag/tree/master/example/celler/controller)

| 注释 | 描述 |
| -------------------- | ------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -597,7 +597,7 @@ type Account struct {

### 使用`swaggertype`标签更改字段类型

[#201](https://github.com/swaggo/swag/issues/201#issuecomment-475479409)
[#201](https://github.com/chaintraced/swag/issues/201#issuecomment-475479409)

```go
type TimestampTime struct {
Expand Down Expand Up @@ -634,7 +634,7 @@ type Account struct {
}
```

[#379](https://github.com/swaggo/swag/issues/379)
[#379](https://github.com/chaintraced/swag/issues/379)

```go
type CerticateKeyPair struct {
Expand Down Expand Up @@ -738,7 +738,7 @@ This project was inspired by [yvasiyarov/swagger](https://github.com/yvasiyarov/
## 贡献者

This project exists thanks to all the people who contribute. [[Contribute](CONTRIBUTING.md)].
<a href="https://github.com/swaggo/swag/graphs/contributors"><img src="https://opencollective.com/swag/contributors.svg?width=890&button=false" /></a>
<a href="https://github.com/chaintraced/swag/graphs/contributors"><img src="https://opencollective.com/swag/contributors.svg?width=890&button=false" /></a>

## 支持者

Expand Down
6 changes: 3 additions & 3 deletions cmd/swag/main.go
Expand Up @@ -9,9 +9,9 @@ import (

"github.com/urfave/cli/v2"

"github.com/swaggo/swag"
"github.com/swaggo/swag/format"
"github.com/swaggo/swag/gen"
"github.com/chaintraced/swag"
"github.com/chaintraced/swag/format"
"github.com/chaintraced/swag/gen"
)

const (
Expand Down
4 changes: 2 additions & 2 deletions doc.go
@@ -1,5 +1,5 @@
/*
Package swag converts Go annotations to Swagger Documentation 2.0.
See https://github.com/swaggo/swag for more information about swag.
See https://github.com/chaintraced/swag for more information about swag.
*/
package swag // import "github.com/swaggo/swag"
package swag // import "github.com/chaintraced/swag"
2 changes: 1 addition & 1 deletion example/basic/api/api.go
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"

"github.com/swaggo/swag/example/basic/web"
"github.com/chaintraced/swag/example/basic/web"
)

// GetStringByInt example
Expand Down
2 changes: 1 addition & 1 deletion example/basic/main.go
Expand Up @@ -3,7 +3,7 @@ package main
import (
"net/http"

"github.com/swaggo/swag/example/basic/api"
"github.com/chaintraced/swag/example/basic/api"
)

// @title Swagger Example API
Expand Down
3 changes: 1 addition & 2 deletions example/celler/README.md
Expand Up @@ -3,7 +3,7 @@
Gen doc

```console
$ go get -u github.com/swaggo/swag/cmd/swag
$ go get -u github.com/chaintraced/swag/cmd/swag
$ swag init
```

Expand All @@ -14,4 +14,3 @@ $ go run main.go
```

[open swagger](http://localhost:8080/swagger/index.html)

4 changes: 2 additions & 2 deletions example/celler/controller/accounts.go
Expand Up @@ -5,9 +5,9 @@ import (
"net/http"
"strconv"

"github.com/chaintraced/swag/example/celler/httputil"
"github.com/chaintraced/swag/example/celler/model"
"github.com/gin-gonic/gin"
"github.com/swaggo/swag/example/celler/httputil"
"github.com/swaggo/swag/example/celler/model"
)

// ShowAccount godoc
Expand Down
4 changes: 2 additions & 2 deletions example/celler/controller/admin.go
Expand Up @@ -5,9 +5,9 @@ import (
"fmt"
"net/http"

"github.com/chaintraced/swag/example/celler/httputil"
"github.com/chaintraced/swag/example/celler/model"
"github.com/gin-gonic/gin"
"github.com/swaggo/swag/example/celler/httputil"
"github.com/swaggo/swag/example/celler/model"
)

// Auth godoc
Expand Down
4 changes: 2 additions & 2 deletions example/celler/controller/bottles.go
Expand Up @@ -6,8 +6,8 @@ import (

"github.com/gin-gonic/gin"

"github.com/swaggo/swag/example/celler/httputil"
"github.com/swaggo/swag/example/celler/model"
"github.com/chaintraced/swag/example/celler/httputil"
"github.com/chaintraced/swag/example/celler/model"
)

// ShowBottle godoc
Expand Down
2 changes: 1 addition & 1 deletion example/celler/controller/examples.go
Expand Up @@ -5,8 +5,8 @@ import (
"net/http"
"strconv"

"github.com/chaintraced/swag/example/celler/httputil"
"github.com/gin-gonic/gin"
"github.com/swaggo/swag/example/celler/httputil"
)

// PingExample godoc
Expand Down
4 changes: 2 additions & 2 deletions example/celler/go.mod
@@ -1,4 +1,4 @@
module github.com/swaggo/swag/example/celler
module github.com/chaintraced/swag/example/celler

go 1.17

Expand All @@ -7,7 +7,7 @@ require (
github.com/gofrs/uuid v4.2.0+incompatible
github.com/swaggo/files v0.0.0-20210815190702-a29dd2bc99b2
github.com/swaggo/gin-swagger v1.4.2
github.com/swaggo/swag v1.8.1
github.com/chaintraced/swag v1.8.1
)

require (
Expand Down

0 comments on commit 30e39b4

Please sign in to comment.