mirror of
https://github.com/harness/drone.git
synced 2025-05-17 01:20:13 +08:00
[MAINT] fixing linter errors (#19)
* fix linter errors * fix exhaust linter error * fix exhaust linter error * fix linter errors * golangci-lint timeout increased * golangci-lint verbose flag
This commit is contained in:
parent
560c08dcca
commit
66f2dadb7a
2
Makefile
2
Makefile
@ -106,7 +106,7 @@ sec:
|
||||
|
||||
lint: tools generate # lint the golang code
|
||||
@echo "Linting $(1)"
|
||||
@golangci-lint run
|
||||
@golangci-lint run --timeout=3m --verbose
|
||||
|
||||
###########################################
|
||||
# Code Generation
|
||||
|
@ -68,7 +68,7 @@ func HandleMove(guard *guard.Guard, repos store.RepoStore, spaces store.SpaceSto
|
||||
return
|
||||
}
|
||||
|
||||
// Ensure we have access to the target space (if its a space move)
|
||||
// Ensure we have access to the target space (if it's a space move)
|
||||
if *in.SpaceID != repo.SpaceID {
|
||||
var newSpace *types.Space
|
||||
newSpace, err = spaces.Find(ctx, *in.SpaceID)
|
||||
|
@ -59,7 +59,9 @@ func HandleMove(guard *guard.Guard, spaces store.SpaceStore) http.HandlerFunc {
|
||||
if err = check.Name(*in.Name); err != nil {
|
||||
render.UserfiedErrorOrInternal(w, err)
|
||||
return
|
||||
} else if *in.ParentID == space.ParentID && *in.Name == space.Name {
|
||||
}
|
||||
|
||||
if *in.ParentID == space.ParentID && *in.Name == space.Name {
|
||||
render.BadRequestError(w, render.ErrNoChange)
|
||||
return
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ func (s *SpaceStore) List(ctx context.Context, id int64, opts *types.SpaceFilter
|
||||
|
||||
switch opts.Sort {
|
||||
case enum.SpaceAttrCreated:
|
||||
// NOTE: string concatination is safe because the
|
||||
// NOTE: string concatenation is safe because the
|
||||
// order attribute is an enum and is not user-defined,
|
||||
// and is therefore not subject to injection attacks.
|
||||
stmt = stmt.OrderBy("space_created " + opts.Order.String())
|
||||
|
Loading…
Reference in New Issue
Block a user