Skip to content

Commit 07625cd

Browse files
project0dominikschulz
authored andcommitted
running with native_host requires initialized first (gopasspw#903)
* running with native_host requires initialized first Signed-off-by: Richard Hillmann <[email protected]> * fix codequality check with lates unconvert release Signed-off-by: Richard Hillmann <[email protected]>
1 parent da38258 commit 07625cd

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

app.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ func setupApp(ctx context.Context, sv semver.Version) *cli.App {
5050
}
5151

5252
app.Action = func(c *cli.Context) error {
53-
if strings.HasSuffix(os.Args[0], "native_host") || strings.HasSuffix(os.Args[0], "native_host.exe") {
54-
return action.JSONAPI(withGlobalFlags(ctx, c), c)
55-
}
56-
5753
if err := action.Initialized(withGlobalFlags(ctx, c), c); err != nil {
5854
return err
5955
}
6056

57+
if strings.HasSuffix(os.Args[0], "native_host") || strings.HasSuffix(os.Args[0], "native_host.exe") {
58+
return action.JSONAPI(withGlobalFlags(ctx, c), c)
59+
}
60+
6161
if c.Args().Present() {
6262
return action.Show(withGlobalFlags(ctx, c), c)
6363
}

pkg/store/secret/yaml_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestYAMLKeyToEmptySecret(t *testing.T) {
5454
// read back key
5555
content, err := s.Value(yamlKey)
5656
assert.NoError(t, err)
57-
assert.Equal(t, yamlValue, string(content))
57+
assert.Equal(t, yamlValue, content)
5858

5959
// read back whole entry
6060
buf, err := s.Bytes()
@@ -92,7 +92,7 @@ func TestYAMLKeyToPWOnlySecret(t *testing.T) {
9292
// read back the key
9393
content, err := s.Value(yamlKey)
9494
assert.NoError(t, err)
95-
assert.Equal(t, yamlValue, string(content))
95+
assert.Equal(t, yamlValue, content)
9696

9797
// read back whole entry
9898
bv, err := s.Bytes()
@@ -177,7 +177,7 @@ ccc
177177
// read back key
178178
content, err := s.Value(yamlKey)
179179
assert.NoError(t, err)
180-
assert.Equal(t, mlValue, string(content))
180+
assert.Equal(t, mlValue, content)
181181
}
182182

183183
func TestYAMLDocMarkerAsPW(t *testing.T) {

0 commit comments

Comments
 (0)