Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/common-go/experiments/noop.go
2498 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package experiments
6
7
import "context"
8
9
var _ Client = (*alwaysReturningDefaultValueClient)(nil)
10
11
type alwaysReturningDefaultValueClient struct{}
12
13
func NewAlwaysReturningDefaultValueClient() Client {
14
return &alwaysReturningDefaultValueClient{}
15
}
16
17
func (c *alwaysReturningDefaultValueClient) GetBoolValue(_ context.Context, _ string, defaultValue bool, _ Attributes) bool {
18
return defaultValue
19
}
20
21
func (c *alwaysReturningDefaultValueClient) GetIntValue(_ context.Context, _ string, defaultValue int, _ Attributes) int {
22
return defaultValue
23
}
24
25
func (c *alwaysReturningDefaultValueClient) GetFloatValue(_ context.Context, _ string, defaultValue float64, _ Attributes) float64 {
26
return defaultValue
27
}
28
29
func (c *alwaysReturningDefaultValueClient) GetStringValue(_ context.Context, _ string, defaultValue string, _ Attributes) string {
30
return defaultValue
31
}
32
33