add shield item of config in .gitignore
This commit is contained in:
parent
f0a66263a3
commit
68a800ce63
|
|
@ -24,3 +24,5 @@ go.work
|
||||||
.vscode
|
.vscode
|
||||||
# Shield all log files in the log folder
|
# Shield all log files in the log folder
|
||||||
/log/
|
/log/
|
||||||
|
# Shield config files in the config folder
|
||||||
|
/config/config.yaml
|
||||||
|
|
|
||||||
|
|
@ -66,17 +66,16 @@ func MeasurementRecommendHandler(c *gin.Context) {
|
||||||
fmt.Printf("finalOffset:%v\n", finalOffset)
|
fmt.Printf("finalOffset:%v\n", finalOffset)
|
||||||
|
|
||||||
resultRecommends := make([]string, 0, len(recommends))
|
resultRecommends := make([]string, 0, len(recommends))
|
||||||
seen := make(map[string]struct{}) // 使用空结构体节省内存
|
seen := make(map[string]struct{})
|
||||||
|
|
||||||
for _, recommend := range recommends {
|
for _, recommend := range recommends {
|
||||||
recommendation := recommend[finalOffset:]
|
recommendTerm := recommend[finalOffset:]
|
||||||
fmt.Printf("resultRecommend:%s\n", recommendation)
|
fmt.Printf("resultRecommend:%s\n", recommendTerm)
|
||||||
fmt.Printf("len of resultRecommend:%d\n", len(recommendation))
|
fmt.Printf("len of resultRecommend:%d\n", len(recommendTerm))
|
||||||
|
if len(recommendTerm) != 0 {
|
||||||
if len(recommendation) != 0 {
|
if _, exists := seen[recommendTerm]; !exists {
|
||||||
if _, exists := seen[recommendation]; !exists {
|
seen[recommendTerm] = struct{}{}
|
||||||
seen[recommendation] = struct{}{}
|
resultRecommends = append(resultRecommends, recommendTerm)
|
||||||
resultRecommends = append(resultRecommends, recommendation)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue