This repository was archived by the owner on Feb 16, 2023. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,13 +6,10 @@ import (
66 "fmt"
77)
88
9- type OPV1CLI struct {
10- version string
11- isV2 bool
12- }
9+ type OPV1CLI struct {}
1310
1411func (op * OPV1CLI ) IsV2 () bool {
15- return op . isV2
12+ return false
1613}
1714
1815func (op * OPV1CLI ) CreateVault (name string ) error {
Original file line number Diff line number Diff line change @@ -7,13 +7,10 @@ import (
77 "os"
88)
99
10- type OPV2CLI struct {
11- version string
12- isV2 bool
13- }
10+ type OPV2CLI struct {}
1411
1512func (op * OPV2CLI ) IsV2 () bool {
16- return op . isV2
13+ return true
1714}
1815
1916func (op * OPV2CLI ) CreateVault (name string ) error {
Original file line number Diff line number Diff line change @@ -32,15 +32,11 @@ func GetOPClient() (OPCLI, error) {
3232 version := strings .TrimSpace (string (out ))
3333
3434 if strings .HasPrefix (version , "2." ) {
35- return & OPV2CLI {
36- version : version ,
37- isV2 : true ,
38- }, nil
39- }
40- return & OPV1CLI {
41- version : version ,
42- isV2 : false ,
43- }, nil
35+ return & OPV2CLI {}, nil
36+ } else if strings .HasPrefix (version , "1." ) {
37+ return & OPV1CLI {}, nil
38+ }
39+ return nil , fmt .Errorf ("1password: op version not recognized" )
4440}
4541
4642func NewItemTemplate () * ItemTemplate {
You can’t perform that action at this time.
0 commit comments