From f17f0ec5e121580c632d897c39f74cfd8cb811fd Mon Sep 17 00:00:00 2001 From: "Xinwei Xiong (cubxxw)" <3293172751nss@gmail.com> Date: Thu, 25 Jan 2024 09:39:33 +0800 Subject: [PATCH] Concurrent Type Checking and Cross-Platform Development in Go --- docker-compose.yml | 1 + go.mod | 2 +- go.sum | 5 +---- test/typecheck/README.md | 4 +++- test/typecheck/typecheck.go | 6 ++---- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 6e9bd7de7..dcf7518e2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -214,6 +214,7 @@ services: # - "${OPENIM_ADMIN_API_PORT:-10009}:10009" # volumes: # - "${DATA_DIR:-./}/components/openim-chat/logs:/openim/openim-chat/logs" + # - "${DATA_DIR:-./}/components/openim-chat/_output/logs:/openim/openim-chat/_output/logs" # - "${DATA_DIR:-./}/components/openim-chat/config:/openim/openim-chat/config" # restart: always # # user: root:root diff --git a/go.mod b/go.mod index 77b572526..fdc6a58de 100644 --- a/go.mod +++ b/go.mod @@ -38,6 +38,7 @@ require ( github.com/aliyun/aliyun-oss-go-sdk v2.2.9+incompatible github.com/go-redis/redis v6.15.9+incompatible github.com/redis/go-redis/v9 v9.2.1 + github.com/spf13/pflag v1.0.5 github.com/stathat/consistent v1.0.0 github.com/tencentyun/cos-go-sdk-v5 v0.7.45 go.uber.org/automaxprocs v1.5.3 @@ -116,7 +117,6 @@ require ( github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rs/xid v1.5.0 // indirect github.com/sergi/go-diff v1.0.0 // indirect - github.com/spf13/pflag v1.0.5 // indirect github.com/src-d/gcfg v1.4.0 // indirect github.com/stretchr/objx v0.5.0 // indirect github.com/twitchyliquid64/golang-asm v0.15.1 // indirect diff --git a/go.sum b/go.sum index 2684b28e2..5539b41fc 100644 --- a/go.sum +++ b/go.sum @@ -15,14 +15,11 @@ cloud.google.com/go/storage v1.30.1 h1:uOdMxAs8HExqBlnLtnQyP0YkvbiDpdGShGKtx6U/o cloud.google.com/go/storage v1.30.1/go.mod h1:NfxhC0UJE1aXSx7CIIbCf7y9HKT7BiccwkR7+P7gN8E= firebase.google.com/go v3.13.0+incompatible h1:3TdYC3DDi6aHn20qoRkxwGqNgdjtblwVAyRLQwGn/+4= firebase.google.com/go v3.13.0+incompatible/go.mod h1:xlah6XbEyW6tbfSklcfe5FHJIwjt8toICdV5Wh9ptHs= -github.com/AndrewZuo01/protocol v0.0.0-20240112093520-fd9c53e27b94 h1:o86vkek41ZrQqoBGqyKvS0z6N0uJj64mpzK72OkDZVM= -github.com/AndrewZuo01/protocol v0.0.0-20240112093520-fd9c53e27b94/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/IBM/sarama v1.41.3 h1:MWBEJ12vHC8coMjdEXFq/6ftO6DUZnQlFYcxtOJFa7c= github.com/IBM/sarama v1.41.3/go.mod h1:Xxho9HkHd4K/MDUo/T/sOqwtX/17D33++E9Wib6hUdQ= +github.com/OpenIMSDK/protocol v0.0.48 h1:8MIMjyzJRsruYhVv2ZKArFiOveroaofDOb3dlAdgjsw= github.com/OpenIMSDK/protocol v0.0.48/go.mod h1:F25dFrwrIx3lkNoiuf6FkCfxuwf8L4Z8UIsdTHP/r0Y= -github.com/OpenIMSDK/tools v0.0.23 h1:xozfrGzhbpNPlDTap5DLVPk+JfgZ/ZyIj4Cuu3/bm9w= -github.com/OpenIMSDK/tools v0.0.23/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/OpenIMSDK/tools v0.0.28 h1:UT0rN1ysCFvsxQXyuxAj2TEkHt4C/sUezy+ChKpgt2Y= github.com/OpenIMSDK/tools v0.0.28/go.mod h1:eg+q4A34Qmu73xkY0mt37FHGMCMfC6CtmOnm0kFEGFI= github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= diff --git a/test/typecheck/README.md b/test/typecheck/README.md index 36d051b1c..e5b76d4c6 100644 --- a/test/typecheck/README.md +++ b/test/typecheck/README.md @@ -47,4 +47,6 @@ In CI environments, Typecheck can be integrated into the workflow as follows: run: make verify ``` -This streamlined process facilitates efficient error detection and resolution, ensuring a robust and reliable build pipeline. \ No newline at end of file +This streamlined process facilitates efficient error detection and resolution, ensuring a robust and reliable build pipeline. + +More to learn about typecheck [share blog](https://nsddd.top/posts/concurrent-type-checking-and-cross-platform-development-in-go/) \ No newline at end of file diff --git a/test/typecheck/typecheck.go b/test/typecheck/typecheck.go index 622ce031a..975ce988d 100644 --- a/test/typecheck/typecheck.go +++ b/test/typecheck/typecheck.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -// do a fast type check of kubernetes code, for all platforms. +// do a fast type check of openim code, for all platforms. package main import ( @@ -47,14 +47,12 @@ var ( crossPlatforms = []string{ "linux/amd64", "windows/386", "darwin/amd64", "darwin/arm64", - "linux/386", + "linux/386", "linux/arm", "windows/amd64", "linux/arm64", "linux/ppc64le", "linux/s390x", "windows/arm64", } - // "linux/arm", - // directories we always ignore standardIgnoreDirs = []string{ // Staging code is symlinked from vendor/k8s.io, and uses import