Skip to content

Commit

Permalink
Fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
minamijoyo committed Apr 25, 2022
1 parent fd73a7b commit fc5a256
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,12 @@ func runMigrationAwsv4upgradeCmd(cmd *cobra.Command, args []string) error {
}

if migrationFile == "-" {
fmt.Fprintf(cmd.OutOrStdout(), string(output))
fmt.Fprint(cmd.OutOrStdout(), string(output))
} else {
// nolint: gosec
// G306: Expect WriteFile permissions to be 0600 or less
// In general, a migration file is expected to commit to git and it does
// not contain any credentials, so there is no problem.
if err := os.WriteFile(migrationFile, output, 0644); err != nil {
return fmt.Errorf("failed to write file: %s", err)
}
Expand Down

0 comments on commit fc5a256

Please sign in to comment.