Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Configuration
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Jira
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Monitor
Service Desk
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSS
Libraries
Go
Application
Configuration
Commits
412af681
Verified
Commit
412af681
authored
2 years ago
by
Volker Schukai
Browse files
Options
Downloads
Patches
Plain Diff
feat implement the copyable interface of xflags
parent
7ceaaf41
No related branches found
No related tags found
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
change.go
+0
-5
0 additions, 5 deletions
change.go
copyable.go
+14
-0
14 additions, 0 deletions
copyable.go
copyable_test.go
+19
-0
19 additions, 0 deletions
copyable_test.go
go.mod
+6
-5
6 additions, 5 deletions
go.mod
go.sum
+13
-0
13 additions, 0 deletions
go.sum
with
52 additions
and
10 deletions
change.go
+
0
−
5
View file @
412af681
...
...
@@ -74,8 +74,3 @@ func (s *Settings[C]) setConfigInternal(config C, lock bool) *Settings[C] {
func
(
s
*
Settings
[
C
])
SetConfig
(
config
C
)
*
Settings
[
C
]
{
return
s
.
setConfigInternal
(
config
,
true
)
}
// Copy implements the xflags.Copyable interface.
func
(
s
*
Settings
[
C
])
Copy
(
config
C
)
{
s
.
setConfigInternal
(
config
,
true
)
}
This diff is collapsed.
Click to expand it.
copyable.go
0 → 100644
+
14
−
0
View file @
412af681
package
configuration
//type Copyable[C any] interface {
// Copy(data C)
//}
//func (s *ConfigStruct6) Copy(p *ConfigStruct6) {
//
//}
// // Copy implements the xflags.Copyable interface.
func
(
s
*
Settings
[
C
])
Copy
(
c
*
Settings
[
C
])
{
s
.
setConfigInternal
(
s
.
config
,
true
)
}
This diff is collapsed.
Click to expand it.
copyable_test.go
0 → 100644
+
19
−
0
View file @
412af681
package
configuration
import
(
"gitlab.schukai.com/oss/libraries/go/application/xflags"
"testing"
)
type
testExecutionStruct
struct
{
}
type
testConfigStruct
struct
{
}
func
TestXFlagsCopyable
(
t
*
testing
.
T
)
{
config
:=
New
(
testConfigStruct
{})
flags
:=
xflags
.
ExecuteWithShadow
(
testExecutionStruct
{},
config
)
flags
.
Parse
([]
string
{
"-a"
,
"command1"
,
"-d"
})
}
This diff is collapsed.
Click to expand it.
go.mod
+
6
−
5
View file @
412af681
...
...
@@ -3,15 +3,15 @@ module gitlab.schukai.com/oss/libraries/go/application/configuration
go 1.19
require (
github.com/fsnotify/fsnotify
v1.
5.4
github.com/fsnotify/fsnotify
v1.
6.0
github.com/imdario/mergo
v0.3.13
github.com/kinbiko/jsonassert
v1.1.1
github.com/magiconair/properties
v1.8.6
github.com/pelletier/go-toml/v2
v2.0.5
github.com/r3labs/diff/v3
v3.0.0
github.com/stretchr/testify
v1.8.0
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.
1
.0
golang.org/x/exp
v0.0.0-2022
0916125017-b168a2c6b86b
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.
3
.0
golang.org/x/exp
v0.0.0-2022
1012211006-4de253d81b95
gopkg.in/yaml.v3
v3.0.1
)
...
...
@@ -20,8 +20,9 @@ require (
github.com/golang/protobuf
v1.5.2 // indirect
github.com/pmezard/go-difflib
v1.0.0 // indirect
github.com/vmihailenco/msgpack
v4.0.4+incompatible // indirect
golang.org/x/net
v0.0.0-20220909164309-bea034e7d591 // indirect
golang.org/x/sys
v0.0.0-20220915200043-7b5979e65e41 // indirect
gitlab.schukai.com/oss/libraries/go/application/xflags
v1.7.0 // indirect
golang.org/x/net
v0.0.0-20221014081412-f15817d10f9b // indirect
golang.org/x/sys
v0.0.0-20221013171732-95e765b1cc43 // indirect
google.golang.org/appengine
v1.6.7 // indirect
google.golang.org/protobuf
v1.28.1 // indirect
)
This diff is collapsed.
Click to expand it.
go.sum
+
13
−
0
View file @
412af681
...
...
@@ -3,6 +3,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew
v1.1.1/go.mod h1:
J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/fsnotify/fsnotify
v1.5.4 h1:
jRbGcIw6P2Meqdwuo0H1p6JVLbL5DHKAKlYndzMwVZI=
github.com/fsnotify/fsnotify
v1.5.4/go.mod h1:
OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU=
github.com/fsnotify/fsnotify
v1.6.0 h1:
n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
github.com/fsnotify/fsnotify
v1.6.0/go.mod h1:
sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
github.com/golang/protobuf
v1.3.1/go.mod h1:
6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf
v1.5.0/go.mod h1:
FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf
v1.5.2 h1:
ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
...
...
@@ -29,18 +31,29 @@ github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PK
github.com/stretchr/testify
v1.8.0/go.mod h1:
yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/vmihailenco/msgpack
v4.0.4+incompatible h1:
dSLoQfGFAo3F6OoNhwUmLwVgaUXK79GlxNBwueZn0xI=
github.com/vmihailenco/msgpack
v4.0.4+incompatible/go.mod h1:
fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk=
gitlab.schukai.com/oss/libraries/go/application/xflags
v1.7.0 h1:
cecZVg+2i9XxTOYoal30Lr5mX9YMPiFbKG/w0OiocCM=
gitlab.schukai.com/oss/libraries/go/application/xflags
v1.7.0/go.mod h1:
KN99uofMnTNcpfKwPbskucCTgwivJa3jfP2BHM4Ac+A=
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.1.0 h1:
4sZ1sQ9JU2KfLWwhpM3rgOa4zG7CNJc+ntWKmya2vl4=
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.1.0/go.mod h1:
RS2rKf5O+rmSBshHLOgjG7dxg5N2MhNYokZOBcuXdX8=
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.3.0 h1:
SZG0BW5ll3WK5ZIOTogjqX8oVHCTxANTDLPxUs7Rnx8=
gitlab.schukai.com/oss/libraries/go/network/http-negotiation
v1.3.0/go.mod h1:
RS2rKf5O+rmSBshHLOgjG7dxg5N2MhNYokZOBcuXdX8=
golang.org/x/crypto
v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:
djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/exp
v0.0.0-20220916125017-b168a2c6b86b h1:
SCE/18RnFsLrjydh/R/s5EVvHoZprqEQUuoxK8q2Pc4=
golang.org/x/exp
v0.0.0-20220916125017-b168a2c6b86b/go.mod h1:
cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
golang.org/x/exp
v0.0.0-20221012211006-4de253d81b95 h1:
sBdrWpxhGDdTAYNqbgBLAR+ULAPPhfgncLr1X0lyWtg=
golang.org/x/exp
v0.0.0-20221012211006-4de253d81b95/go.mod h1:
cyybsKvd6eL0RnXn6p/Grxp8F5bW7iYuBgsNCOHpMYE=
golang.org/x/net
v0.0.0-20190603091049-60506f45cf65/go.mod h1:
HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks=
golang.org/x/net
v0.0.0-20220909164309-bea034e7d591 h1:
D0B/7al0LLrVC8aWF4+oxpv/m8bc7ViFfVS8/gXGdqI=
golang.org/x/net
v0.0.0-20220909164309-bea034e7d591/go.mod h1:
YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/net
v0.0.0-20221014081412-f15817d10f9b h1:
tvrvnPFcdzp294diPnrdZZZ8XUt2Tyj7svb7X52iDuU=
golang.org/x/net
v0.0.0-20221014081412-f15817d10f9b/go.mod h1:
YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk=
golang.org/x/sys
v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:
STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys
v0.0.0-20220412211240-33da011f77ad/go.mod h1:
oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys
v0.0.0-20220908164124-27713097b956/go.mod h1:
oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys
v0.0.0-20220915200043-7b5979e65e41 h1:
ohgcoMbSofXygzo6AD2I1kz3BFmW1QArPYTtwEM3UXc=
golang.org/x/sys
v0.0.0-20220915200043-7b5979e65e41/go.mod h1:
oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys
v0.0.0-20221013171732-95e765b1cc43 h1:
OK7RB6t2WQX54srQQYSXMW8dF5C6/8+oA/s5QBmmto4=
golang.org/x/sys
v0.0.0-20221013171732-95e765b1cc43/go.mod h1:
oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/text
v0.3.0/go.mod h1:
NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text
v0.3.2/go.mod h1:
bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
golang.org/x/tools
v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:
n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment