Skip to content

Commit

Permalink
feat: NewClientMetadata constructor (#133)
Browse files Browse the repository at this point in the history
constructor for client metadata

Signed-off-by: James Milligan <james@omnant.co.uk>

Signed-off-by: James Milligan <james@omnant.co.uk>
  • Loading branch information
james-milligan authored Jan 10, 2023
1 parent 728cd4b commit fa8b15b
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions pkg/openfeature/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ type ClientMetadata struct {
name string
}

// NewClientMetadata constructs ClientMetadata
// Allows for simplified hook test cases while maintaining immutability
func NewClientMetadata(name string) ClientMetadata {
return ClientMetadata{
name: name,
}
}

// Name returns the client's name
func (cm ClientMetadata) Name() string {
return cm.name
Expand Down

0 comments on commit fa8b15b

Please sign in to comment.