mirror of
https://github.com/bitechdev/ResolveSpec.git
synced 2026-01-05 11:24:26 +00:00
fix: lint issues and docs
This commit is contained in:
@@ -156,7 +156,7 @@ func NewDefaultMIMEResolver() *DefaultMIMEResolver {
|
||||
resolver.RegisterMIMEType(".stl", "model/stl")
|
||||
|
||||
// Other common web assets
|
||||
resolver.RegisterMIMEType(".map", "application/json") // Source maps
|
||||
resolver.RegisterMIMEType(".map", "application/json") // Source maps
|
||||
resolver.RegisterMIMEType(".swf", "application/x-shockwave-flash")
|
||||
resolver.RegisterMIMEType(".apk", "application/vnd.android.package-archive")
|
||||
resolver.RegisterMIMEType(".dmg", "application/x-apple-diskimage")
|
||||
|
||||
@@ -37,7 +37,7 @@ type ZipFile struct {
|
||||
|
||||
func (f *ZipFile) Stat() (fs.FileInfo, error) {
|
||||
if f.File != nil {
|
||||
return f.File.FileInfo(), nil
|
||||
return f.FileInfo(), nil
|
||||
}
|
||||
return nil, fmt.Errorf("No file")
|
||||
}
|
||||
@@ -52,7 +52,7 @@ func (f *ZipFile) Close() error {
|
||||
func (f *ZipFile) Read(b []byte) (int, error) {
|
||||
if f.rc == nil {
|
||||
var err error
|
||||
f.rc, err = f.File.Open()
|
||||
f.rc, err = f.Open()
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@@ -83,7 +83,7 @@ func (f *ZipFile) Seek(offset int64, whence int) (int64, error) {
|
||||
}
|
||||
f.offset += offset
|
||||
case io.SeekEnd:
|
||||
size := int64(f.File.UncompressedSize64)
|
||||
size := int64(f.UncompressedSize64)
|
||||
if size+offset < 0 {
|
||||
return 0, &fs.PathError{Op: "seek", Path: f.Name, Err: fmt.Errorf("negative position")}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user