Skip to content

Commit 1dc8a21

Browse files
committed
fix lint
1 parent 0fc5af7 commit 1dc8a21

File tree

2 files changed

+12
-15
lines changed

2 files changed

+12
-15
lines changed

.golangci.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,3 @@ issues:
144144
- path: models/user/openid.go
145145
linters:
146146
- golint
147-
# does not work with bool
148-
- path: modules/charset/escape.go
149-
linters:
150-
- revive

modules/charset/escape.go

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,18 @@ type EscapeStatus struct {
3131

3232
// Or combines two EscapeStatus structs into one representing the conjunction of the two
3333
func (status EscapeStatus) Or(other EscapeStatus) EscapeStatus {
34-
status.Escaped = status.Escaped || other.Escaped
35-
status.HasError = status.HasError || other.HasError
36-
status.HasBadRunes = status.HasBadRunes || other.HasBadRunes
37-
status.HasControls = status.HasControls || other.HasControls
38-
status.HasSpaces = status.HasSpaces || other.HasSpaces
39-
status.HasMarks = status.HasMarks || other.HasMarks
40-
status.HasBIDI = status.HasBIDI || other.HasBIDI
41-
status.BadBIDI = status.BadBIDI || other.BadBIDI
42-
status.HasRTLScript = status.HasRTLScript || other.HasRTLScript
43-
status.HasLTRScript = status.HasLTRScript || other.HasLTRScript
44-
return status
34+
st := status
35+
st.Escaped = st.Escaped || other.Escaped
36+
st.HasError = st.HasError || other.HasError
37+
st.HasBadRunes = st.HasBadRunes || other.HasBadRunes
38+
st.HasControls = st.HasControls || other.HasControls
39+
st.HasSpaces = st.HasSpaces || other.HasSpaces
40+
st.HasMarks = st.HasMarks || other.HasMarks
41+
st.HasBIDI = st.HasBIDI || other.HasBIDI
42+
st.BadBIDI = st.BadBIDI || other.BadBIDI
43+
st.HasRTLScript = st.HasRTLScript || other.HasRTLScript
44+
st.HasLTRScript = st.HasLTRScript || other.HasLTRScript
45+
return st
4546
}
4647

4748
// EscapeControlString escapes the unicode control sequences in a provided string and returns the findings as an EscapeStatus and the escaped string

0 commit comments

Comments
 (0)