Skip to content

Commit

Permalink
remove unused const
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbloss committed Oct 12, 2023
1 parent 20f1fa8 commit 094d27d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions clientGQL_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,6 @@ import (
"github.com/rs/zerolog/log"
)

const (
queryPrefix string = `"query":`
varPrefix string = `"variables":`
)

func TestMain(m *testing.M) {
output := zerolog.ConsoleWriter{Out: os.Stderr}
log.Logger = log.Output(output)
Expand Down Expand Up @@ -167,7 +162,6 @@ func (t *TestRequest) IsValidJson(data string) bool {

func (t *TestRequest) ParseRequest(rawRequest string) {
parsedRequest, _ := t.templater.ParseTemplatedString(rawRequest)
// queryValue, _ := strings.CutPrefix(rawRequest, queryPrefix)
jsonFormattedRequest := fmt.Sprintf("{%s}", parsedRequest)
if !t.IsValidJson(jsonFormattedRequest) {
panic(fmt.Errorf("test request could not be JSON formatted: %s", parsedRequest))
Expand All @@ -185,6 +179,7 @@ func (t *TestRequest) ParseVariables(rawVariables string) {
panic(err)
}

varPrefix := `"variables":`
jsonFormattedVariableObject := strings.TrimSpace(parsedVariables)
jsonFormattedVariableObject, _ = strings.CutPrefix(jsonFormattedVariableObject, varPrefix)
if !t.IsValidJson(jsonFormattedVariableObject) {
Expand Down

0 comments on commit 094d27d

Please sign in to comment.