Skip to content

Commit aec868f

Browse files
committed
all: explicitly ignore fmt.Fprint errors
Change-Id: Ie36f1e00a10a5c114bededdb4fdbe9dc149630cf
1 parent 711d9a9 commit aec868f

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

identity/certificate_authority.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ func NewCA(ctx context.Context, opts NewCAOptions) (_ *FullCertificateAuthority,
102102
}
103103

104104
if opts.Logger != nil {
105-
fmt.Fprintf(opts.Logger, "Generating key with a minimum a difficulty of %d...\n", opts.Difficulty)
105+
_, _ = fmt.Fprintf(opts.Logger, "Generating key with a minimum a difficulty of %d...\n", opts.Difficulty)
106106
}
107107

108108
version, err := storj.GetIDVersion(opts.VersionNumber)

process/exec_conf.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -420,10 +420,10 @@ func cleanup(cmd *cobra.Command, opts *ExecOptions) {
420420
switch *logOutput {
421421
case "stdout":
422422
logger.Debug("Unrecoverable error", zap.Error(err))
423-
fmt.Fprintln(os.Stdout, "Error:", err.Error())
423+
_, _ = fmt.Fprintln(os.Stdout, "Error:", err.Error())
424424
case "stderr":
425425
logger.Debug("Unrecoverable error", zap.Error(err))
426-
fmt.Fprintln(os.Stderr, "Error:", err.Error())
426+
_, _ = fmt.Fprintln(os.Stderr, "Error:", err.Error())
427427
default:
428428
logger.Fatal("Unrecoverable error", zap.Error(err))
429429
}

process/logging.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ func sortedKeys(m map[string]interface{}) []string {
198198
func (p *prettyEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field) (*buffer.Buffer, error) {
199199
b := p.pool.Get()
200200

201-
fmt.Fprintf(b, "%s\t%s\t%s\n",
201+
_, _ = fmt.Fprintf(b, "%s\t%s\t%s\n",
202202
entry.Time.Format("15:04:05.000"),
203203
levelDecorate(entry.Level, entry.Level.CapitalString()),
204204
entry.Message)
@@ -210,7 +210,7 @@ func (p *prettyEncoder) EncodeEntry(entry zapcore.Entry, fields []zapcore.Field)
210210
if key == "errorVerbose" && !*logDev {
211211
continue
212212
}
213-
fmt.Fprintf(b, "\t%s: %s\n",
213+
_, _ = fmt.Fprintf(b, "\t%s: %s\n",
214214
key,
215215
strings.ReplaceAll(fmt.Sprint(m.Fields[key]), "\n", "\n\t"))
216216
}

0 commit comments

Comments
 (0)