fix: lint errors and update Nix vendorHash
- Add nolint:unparam for readOnly param in sqlite_open.go - Handle cmd.Help() error in wisp.go - Handle rows.Close() error in migration 028 - Handle targetStore.Close() error in create.go - Update Nix vendorHash for current dependencies Cherry-picked from PR #769
This commit is contained in:
@@ -496,7 +496,11 @@ func createInRig(cmd *cobra.Command, rigName, title, description, issueType stri
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
FatalError("failed to open rig %q database: %v", rigName, err)
|
FatalError("failed to open rig %q database: %v", rigName, err)
|
||||||
}
|
}
|
||||||
defer targetStore.Close()
|
defer func() {
|
||||||
|
if err := targetStore.Close(); err != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "warning: failed to close rig database: %v\n", err)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
var externalRefPtr *string
|
var externalRefPtr *string
|
||||||
if externalRef != "" {
|
if externalRef != "" {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
//nolint:unparam // readOnly is used to add mode=ro to connection string
|
||||||
func sqliteConnString(path string, readOnly bool) string {
|
func sqliteConnString(path string, readOnly bool) string {
|
||||||
path = strings.TrimSpace(path)
|
path = strings.TrimSpace(path)
|
||||||
if path == "" {
|
if path == "" {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ const OldThreshold = 24 * time.Hour
|
|||||||
func runWisp(cmd *cobra.Command, args []string) {
|
func runWisp(cmd *cobra.Command, args []string) {
|
||||||
if len(args) == 0 {
|
if len(args) == 0 {
|
||||||
// No proto-id provided, show help
|
// No proto-id provided, show help
|
||||||
cmd.Help()
|
_ = cmd.Help()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// Delegate to the create logic
|
// Delegate to the create logic
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ pkgs.buildGoModule {
|
|||||||
subPackages = [ "cmd/bd" ];
|
subPackages = [ "cmd/bd" ];
|
||||||
doCheck = false;
|
doCheck = false;
|
||||||
# Go module dependencies hash - if build fails with hash mismatch, update with the "got:" value
|
# Go module dependencies hash - if build fails with hash mismatch, update with the "got:" value
|
||||||
vendorHash = "sha256-Brzb6HZHYtF8LTkP3uQ21GG72c5ekzSkQ2EdrqkdeO0=";
|
vendorHash = "sha256-ovG0EWQFtifHF5leEQTFvTjGvc+yiAjpAaqaV0OklgE=";
|
||||||
|
|
||||||
# Git is required for tests
|
# Git is required for tests
|
||||||
nativeBuildInputs = [ pkgs.git ];
|
nativeBuildInputs = [ pkgs.git ];
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ func MigrateTombstoneClosedAt(db *sql.DB) error {
|
|||||||
var notnull, pk int
|
var notnull, pk int
|
||||||
var dflt interface{}
|
var dflt interface{}
|
||||||
if err := rows.Scan(&cid, &name, &ctype, ¬null, &dflt, &pk); err != nil {
|
if err := rows.Scan(&cid, &name, &ctype, ¬null, &dflt, &pk); err != nil {
|
||||||
rows.Close()
|
_ = rows.Close()
|
||||||
return fmt.Errorf("failed to scan table info: %w", err)
|
return fmt.Errorf("failed to scan table info: %w", err)
|
||||||
}
|
}
|
||||||
if name == "created_by" {
|
if name == "created_by" {
|
||||||
|
|||||||
Reference in New Issue
Block a user