Commit 68c9c9e7 authored by Joshua Gutow's avatar Joshua Gutow

Use strings package to check for a prefix

parent 25b5f1cc
......@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
if envVar == "" {
t.Errorf("Failed to find EnvVar for flag %v", flag.GetName())
}
if envVar[:len("OP_CHALLENGER_")] != "OP_CHALLENGER_" {
if !strings.HasPrefix(envVar, "OP_CHALLENGER_") {
t.Errorf("Flag %v env var (%v) does not start with OP_CHALLENGER_", flag.GetName(), envVar)
}
if strings.Contains(envVar, "__") {
......
......@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
if envVar == "" {
t.Errorf("Failed to find EnvVar for flag %v", flag.GetName())
}
if envVar[:len("OP_PROGRAM_")] != "OP_PROGRAM_" {
if !strings.HasPrefix(envVar, "OP_PROGRAM_") {
t.Errorf("Flag %v env var (%v) does not start with OP_PROGRAM_", flag.GetName(), envVar)
}
if strings.Contains(envVar, "__") {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment