kubesphere / kubesphere/notification-manager

go vet error

Open
#180 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
240
Forks
116
PR merge metrics
No merged PRs in 30d

Description

我尝试做一些功能开发。本地测试发现go vet 会报错,虽然我的本地版本是go 1.9.但我认为这个报错应该解决。但我不知道从哪里下手。

```
pkg/notify/notifier/token.go:46:12: assignment copies lock value to t: (github.com/kubesphere/notification-manager/pkg/notify/notifier.token, bool) contains github.com/kubesphere/notification-manager/pkg/notify/notifier.token contains sync.Mutex
```
我看见token里面确实有mutex对象。这个对象在赋值的时候会对mutex进行拷贝。这段代码在2020年开发的,当时的版本应该go vet没检查到。现在最新的可能已经检查到这个bug了。

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at pkg/notify/notifier/token.go:46 and inspect the assignment reported by go vet, along with the token type and its sync.Mutex field. Run go vet with the repository's Go setup to reproduce the warning; done means the reported lock-copy error is resolved and go vet passes.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.