forked from wundergraph/graphql-go-tools
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor loader (wundergraph#654)
Co-authored-by: Sergiy <818351+devsergiy@users.noreply.github.com>
- Loading branch information
Showing
32 changed files
with
4,157 additions
and
722 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
//go:build !go1.20 | ||
|
||
package gocompat | ||
|
||
import ( | ||
"reflect" | ||
"unsafe" | ||
) | ||
|
||
func GetUnsafeByteSliceByString(str *string) []byte { | ||
stringHdr := (*reflect.StringHeader)(unsafe.Pointer(str)) | ||
return unsafe.Slice((*byte)(unsafe.Pointer(stringHdr.Data)), len(*str)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
//go:build go1.20 | ||
|
||
package gocompat | ||
|
||
import ( | ||
"unsafe" | ||
) | ||
|
||
func GetUnsafeByteSliceByString(str *string) []byte { | ||
return unsafe.Slice(unsafe.StringData(*str), len(*str)) | ||
} |
Oops, something went wrong.