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