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
Hello, I found a problem in the operation of one of the UnmarshalXML in Map.
This code will cause os.ErrNotExist on windows for data/world/surface-tileset.tmx even if the file is there:
//go:embed datavarfs embed.FS...// File surface.tmx has reference to surface-tileset.tmx in it.tiled.LoadFile("data/world/surface.tmx", tiled.WithFileSystem(fs))
Which will return the path with windows-like slashes data\world\surface-tileset.tmx. This path will not work with embed: golang/go#44305
Despite the fact that these are details of the implementation of a specific fs, it is part of the standard library.
So it makes sense to take these details into account inside the lib.
Solution A
Add a wrapper that converts paths in special cases.
Problem
Hello, I found a problem in the operation of one of the UnmarshalXML in Map.
This code will cause
os.ErrNotExist
on windows fordata/world/surface-tileset.tmx
even if the file is there:The library allows you to insert your own fs implementation to upload files:
https://github.com/lafriks/go-tiled/blob/main/tiled.go#L76
In the process, it loads additional files (for example, tileset) for which it builds a path as follows:
https://github.com/lafriks/go-tiled/blob/main/tmx_map.go#L173
Which will return the path with windows-like slashes
data\world\surface-tileset.tmx
. This path will not work with embed:golang/go#44305
Despite the fact that these are details of the implementation of a specific fs, it is part of the standard library.
So it makes sense to take these details into account inside the lib.
Solution A
Add a wrapper that converts paths in special cases.
Solution B
Add the option to use
path.Join
instead offilepath.Join
for special occasions.Looks like it the same as #63.
The text was updated successfully, but these errors were encountered: