Skip to content

Commit 8ccc01e

Browse files
authored
Remove old code and bump (#102)
* remove old unmarshal * bump patch version
1 parent 60611fe commit 8ccc01e

File tree

2 files changed

+4
-19
lines changed

2 files changed

+4
-19
lines changed

client/lessons.go

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ package api
33
import (
44
"encoding/json"
55
"fmt"
6-
"strings"
76
)
87

98
type Lesson struct {
@@ -178,24 +177,10 @@ func SubmitCLILesson(uuid string, results []CLIStepResult) (*VerificationResultS
178177
return nil, fmt.Errorf("failed to submit CLI lesson (code: %v): %s", code, string(resp))
179178
}
180179

181-
if strings.Contains(string(resp), `"StructuredErrCLI"`) {
182-
result := verificationResult{}
183-
err = json.Unmarshal(resp, &result)
184-
if err != nil {
185-
return nil, err
186-
}
187-
return result.StructuredErrCLI, nil
188-
}
189-
// TODO: delete this, it's for backwards compatibility
190-
// it used to be a top-object
191-
var failure VerificationResultStructuredErrCLI
192-
err = json.Unmarshal(resp, &failure)
180+
result := verificationResult{}
181+
err = json.Unmarshal(resp, &result)
193182
if err != nil {
194183
return nil, err
195184
}
196-
if failure.ErrorMessage == "" {
197-
// no structured error, return nil, this is success
198-
return nil, nil
199-
}
200-
return &failure, nil
185+
return result.StructuredErrCLI, nil
201186
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v1.20.0
1+
v1.20.1

0 commit comments

Comments
 (0)