Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
45fa82ec
Unverified
Commit
45fa82ec
authored
2 years ago
by
OptimismBot
Committed by
GitHub
2 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5653 from ethereum-optimism/jg/cleanup
Use strings package to check for a prefix
parents
25b5f1cc
68c9c9e7
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
flags_test.go
op-challenger/flags/flags_test.go
+1
-1
flags_test.go
op-program/host/flags/flags_test.go
+1
-1
No files found.
op-challenger/flags/flags_test.go
View file @
45fa82ec
...
@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
...
@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
if
envVar
==
""
{
if
envVar
==
""
{
t
.
Errorf
(
"Failed to find EnvVar for flag %v"
,
flag
.
GetName
())
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
)
t
.
Errorf
(
"Flag %v env var (%v) does not start with OP_CHALLENGER_"
,
flag
.
GetName
(),
envVar
)
}
}
if
strings
.
Contains
(
envVar
,
"__"
)
{
if
strings
.
Contains
(
envVar
,
"__"
)
{
...
...
This diff is collapsed.
Click to expand it.
op-program/host/flags/flags_test.go
View file @
45fa82ec
...
@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
...
@@ -40,7 +40,7 @@ func TestCorrectEnvVarPrefix(t *testing.T) {
if
envVar
==
""
{
if
envVar
==
""
{
t
.
Errorf
(
"Failed to find EnvVar for flag %v"
,
flag
.
GetName
())
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
)
t
.
Errorf
(
"Flag %v env var (%v) does not start with OP_PROGRAM_"
,
flag
.
GetName
(),
envVar
)
}
}
if
strings
.
Contains
(
envVar
,
"__"
)
{
if
strings
.
Contains
(
envVar
,
"__"
)
{
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment