mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-12-04 05:43:27 +01:00
Def, Request, DirID, and Source said too little, and short variables and doc comments that skip their name hid intent. varnamelen and staticcheck ST1020-22 now keep both from coming back.
22 lines
435 B
Go
22 lines
435 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/spf13/cobra"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
// setHome sets USERPROFILE too, because Windows reads it rather than HOME.
|
|
func setHome(t *testing.T, home string) {
|
|
t.Helper()
|
|
t.Setenv("HOME", home)
|
|
t.Setenv("USERPROFILE", home)
|
|
}
|
|
|
|
func runCmd(t *testing.T, command *cobra.Command, args ...string) {
|
|
t.Helper()
|
|
command.SetArgs(args)
|
|
require.NoError(t, command.Execute())
|
|
}
|