You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the assets are loaded for v2 in Windows, the path of the embedded license files is split on os.PathSeparator but this is incorrect for Windows.
When trying to split using backslash, there is an index out of range panic
panic: runtime error: index out of range [1] with length 1 [recovered]
panic: runtime error: index out of range [1] with length 1
As per the embed documentation (https://pkg.go.dev/embed) - Even on Windows, the separator for embedded filesystem is forward slash
The //go:embed directive accepts multiple space-separated patterns for brevity, but it can also be repeated, to avoid very long lines when there are many patterns. The patterns are interpreted relative to the package directory containing the source file. The path separator is a forward slash, even on Windows systems. Patterns may not contain ‘.’ or ‘..’ or empty path elements, nor may they begin or end with a slash. To match everything in the current directory, use ‘*’ instead of ‘.’. To allow for naming files with spaces in their names, patterns can be written as Go double-quoted or back-quoted string literals.
The text was updated successfully, but these errors were encountered:
owenrumney
changed the title
bug: NPE when splitting path while loading assets on windows
bug: Index out of range when splitting path while loading assets on windows
Sep 7, 2022
When the assets are loaded for v2 in Windows, the path of the embedded license files is split on
os.PathSeparator
but this is incorrect for Windows.When trying to split using backslash, there is an index out of range panic
As per the embed documentation (https://pkg.go.dev/embed) - Even on Windows, the separator for embedded filesystem is forward slash
The text was updated successfully, but these errors were encountered: