diff --git a/.goreleaser.yaml b/.goreleaser.yaml index b517defb..c0919693 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -65,8 +65,6 @@ archives: dst: NOTICE - src: "docs/release/licenses/*" dst: licenses/ - - src: "DISCLAIMER" - dst: DISCLAIMER wrap_in_directory: true checksum: name_template: 'checksums.txt' diff --git a/DISCLAIMER b/DISCLAIMER deleted file mode 100644 index 009fd82b..00000000 --- a/DISCLAIMER +++ /dev/null @@ -1,10 +0,0 @@ -Apache Answer is an effort undergoing incubation at the Apache -Software Foundation (ASF), sponsored by the Apache Incubator PMC. - -Incubation is required of all newly accepted projects until a further review -indicates that the infrastructure, communications, and decision making process -have stabilized in a manner consistent with other successful ASF projects. - -While incubation status is not necessarily a reflection of the completeness -or stability of the code, it does indicate that the project has yet to be -fully endorsed by the ASF. \ No newline at end of file diff --git a/internal/controller/answer_controller.go b/internal/controller/answer_controller.go index 4504f881..157e1b25 100644 --- a/internal/controller/answer_controller.go +++ b/internal/controller/answer_controller.go @@ -284,10 +284,6 @@ func (ac *AnswerController) Add(ctx *gin.Context) { objectOwner := ac.rankService.CheckOperationObjectOwner(ctx, req.UserID, info.ID) req.CanEdit = canList[0] || objectOwner req.CanDelete = canList[1] || objectOwner - if !can { - handler.HandleResponse(ctx, errors.Forbidden(reason.RankFailToMeetTheCondition), nil) - return - } info.MemberActions = permission.GetAnswerPermission(ctx, req.UserID, info.UserID, 0, req.CanEdit, req.CanDelete, false) handler.HandleResponse(ctx, nil, gin.H{ diff --git a/pkg/uid/id.go b/pkg/uid/id.go index 3614ea5e..f2c72bae 100644 --- a/pkg/uid/id.go +++ b/pkg/uid/id.go @@ -34,9 +34,9 @@ type SnowFlakeID struct { var snowFlakeIDGenerator *SnowFlakeID func init() { - // todo - rand.Seed(time.Now().UnixNano()) - node, err := snowflake.NewNode(int64(rand.Intn(1000)) + 1) + source := rand.NewSource(time.Now().UnixNano()) + r := rand.New(source) + node, err := snowflake.NewNode(int64(r.Intn(1000)) + 1) if err != nil { panic(err.Error()) }