-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: better code style and unit testing (#1)
* refactor(logger): make it more flexible * fix: better performance code and unit testing * fix: more unit testing * fix: more unit testing * ci: update ci * feat: release 1.0.1 * docs: add changelog
- Loading branch information
Showing
23 changed files
with
1,390 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: Unit Testing | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, macos-latest] | ||
go-version: ["1.21", "1.22", "1.23"] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
|
||
- name: Run tests | ||
run: | | ||
go test -v -cover ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Publish | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.21' | ||
|
||
- name: Module tidy | ||
run: go mod tidy | ||
|
||
- name: Publish to proxy | ||
env: | ||
GOPROXY: proxy.golang.org | ||
run: | | ||
# 确保所有依赖项都正确安装 | ||
go list -m all | ||
# 使用 go list 命令请求版本的代理缓存,以便 proxy.golang.org 缓存新版本 | ||
go list -m github.com/growingio/growingio-sdk-go@${GITHUB_REF#refs/tags/} | ||
echo "Published to proxy.golang.org" | ||
- name: Confirm the module is available on proxy.golang.org | ||
run: | | ||
curl -sL https://proxy.golang.org/github.com/growingio/growingio-sdk-go/@v/${GITHUB_REF#refs/tags/}.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
## [1.0.1](https://github.com/growingio/growingio-sdk-go/tree/v1.0.1) (2024-11-11) | ||
|
||
### Changed | ||
|
||
* 更好的调用性能 | ||
* 提升代码质量 | ||
* 添加单元测试 | ||
|
||
## [1.0.0](https://github.com/growingio/growingio-sdk-go/tree/v1.0.0) (2024-10-23) | ||
|
||
### Features | ||
|
||
* 支持埋点事件 | ||
* 支持用户属性事件 | ||
* 支持维度表上报 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
// | ||
// @license | ||
// Copyright (C) 2024 Beijing Yishu Technology Co., Ltd. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
dir: . | ||
filename: "mock_{{.InterfaceName | snakecase}}_test.go" | ||
boilerplate-file: ../../hack/boilerplate/boilerplate.generatego.txt | ||
inpackage: true | ||
with-expecter: true | ||
packages: | ||
github.com/growingio/growingio-sdk-go/internal/core: | ||
interfaces: | ||
Batch: | ||
Request: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.