Skip to content

Commit 2a0ad8b

Browse files
committed
forces a copy of the byte slice
1 parent 8fd064b commit 2a0ad8b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

router/pkg/schemaloader/loader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ func getOperationNameAndType(doc *ast.Document) (string, string, error) {
178178
}
179179

180180
if opDef.Name.Length() > 0 {
181-
return doc.Input.ByteSliceString(opDef.Name), opType, nil
181+
return string(doc.Input.ByteSlice(opDef.Name)), opType, nil
182182
}
183183
return "", opType, nil
184184
}
@@ -192,7 +192,7 @@ func extractOperationDescription(doc *ast.Document) string {
192192
if ref.Kind == ast.NodeKindOperationDefinition {
193193
opDef := doc.OperationDefinitions[ref.Ref]
194194
if opDef.Description.IsDefined && opDef.Description.Content.Length() > 0 {
195-
description := doc.Input.ByteSliceString(opDef.Description.Content)
195+
description := string(doc.Input.ByteSlice(opDef.Description.Content))
196196
return strings.TrimSpace(description)
197197
}
198198
return ""

0 commit comments

Comments
 (0)