fixed lint errors

pull/13263/head
Steven Powell 2022-01-04 10:37:15 -08:00
parent 6adc8ed1cb
commit c7d8220056
2 changed files with 8 additions and 4 deletions

View File

@ -40,13 +40,11 @@ func main() {
if err != nil {
log.Fatalf("failed opening source file %q: %v", *dataFile, err)
}
defer data.Close()
dataLast90, err := os.OpenFile(*dataLast90File, os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
log.Fatalf("failed creating target file %q: %v", *dataLast90File, err)
}
defer dataLast90.Close()
dw := bufio.NewWriter(dataLast90)
@ -95,6 +93,12 @@ func main() {
if err := s.Err(); err != nil {
log.Fatalf("scanner had an error: %v", err)
}
if err := data.Close(); err != nil {
log.Fatalf("failed to close source file: %v", err)
}
if err := dataLast90.Close(); err != nil {
log.Fatalf("failed to close target file: %v", err)
}
}
func write(dw *bufio.Writer, line string) {

View File

@ -1,7 +1,7 @@
#!/bin/bash
# Copyright 2021 The Kubernetes Authors All rights reserved.
#
# Copyright 2022 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at