Depress gosec false positive (#7899)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/7918/head
congqixia 2021-09-14 18:37:48 +08:00 committed by GitHub
parent 06d4faf771
commit 7d53e44f3b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 4 deletions

View File

@ -153,10 +153,10 @@ func TestTimeEncoder(t *testing.T) {
// See [logger-header]https://github.com/tikv/rfcs/blob/master/text/2018-12-19-unified-log-format.md#log-header-section.
func TestZapCaller(t *testing.T) {
data := []zapcore.EntryCaller{
{Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: "server.go", Line: 132},
{Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: "server/coordinator.go", Line: 20},
{Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: `z\test_coordinator1.go`, Line: 20},
{Defined: false, PC: uintptr(unsafe.Pointer(nil)), File: "", Line: 0},
/* #nosec G103 */ {Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: "server.go", Line: 132},
/* #nosec G103 */ {Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: "server/coordinator.go", Line: 20},
/* #nosec G103 */ {Defined: true, PC: uintptr(unsafe.Pointer(nil)), File: `z\test_coordinator1.go`, Line: 20},
/* #nosec G103 */ {Defined: false, PC: uintptr(unsafe.Pointer(nil)), File: "", Line: 0},
}
expect := []string{
"server.go:132",

View File

@ -340,6 +340,7 @@ func (c *Core) checkFlushedSegments(ctx context.Context) {
}
}
for _, idxInfo := range indexInfos {
/* #nosec G601 */
field, err := GetFieldSchemaByID(&collMeta, idxInfo.FiledID)
if err != nil {
log.Debug("GetFieldSchemaByID",