• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

optimizely / go-sdk / 15495407570

06 Jun 2025 04:38PM UTC coverage: 91.652%. Remained the same
15495407570

Pull #407

github

web-flow
Update README.md - test only
Pull Request #407: Update README.md - test only

5072 of 5534 relevant lines covered (91.65%)

10187.4 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/pkg/decide/decide_errors.go
1
/****************************************************************************
2
 * Copyright 2020-2021, Optimizely, Inc. and contributors                   *
3
 *                                                                          *
4
 * Licensed under the Apache License, Version 2.0 (the "License");          *
5
 * you may not use this file except in compliance with the License.         *
6
 * You may obtain a copy of the License at                                  *
7
 *                                                                          *
8
 *    http://www.apache.org/licenses/LICENSE-2.0                            *
9
 *                                                                          *
10
 * Unless required by applicable law or agreed to in writing, software      *
11
 * distributed under the License is distributed on an "AS IS" BASIS,        *
12
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
13
 * See the License for the specific language governing permissions and      *
14
 * limitations under the License.                                           *
15
 ***************************************************************************/
16

17
// Package decide has error definitions for decide api
18
package decide
19

20
import (
21
        "fmt"
22
)
23

24
type decideMessage string
25

26
const (
27
        // SDKNotReady when sdk is not ready
28
        SDKNotReady decideMessage = "Optimizely SDK not configured properly yet."
29
        // FlagKeyInvalid when invalid flag key is provided
30
        FlagKeyInvalid decideMessage = `No flag was found for key "%s".`
31
        // VariableValueInvalid when invalid variable value is provided
32
        VariableValueInvalid decideMessage = `Variable value for key "%s" is invalid or wrong type.`
33
)
34

35
// GetDecideMessage returns message for decide type
36
func GetDecideMessage(messageType decideMessage, arguments ...interface{}) string {
×
37
        return fmt.Sprintf(string(messageType), arguments...)
×
38
}
×
39

40
// GetDecideError returns error for decide type
41
func GetDecideError(messageType decideMessage, arguments ...interface{}) error {
×
42
        return fmt.Errorf(string(messageType), arguments...)
×
43
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc