v0.0.289 fsext
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m31s
All checks were successful
Build Docker and Deploy / Run goext test-suite (push) Successful in 2m31s
This commit is contained in:
parent
7b8ab03779
commit
06d81f1682
@ -11,14 +11,15 @@ Potentially needs `export GOPRIVATE="gogs.mikescher.com"`
|
|||||||
### Packages:
|
### Packages:
|
||||||
|
|
||||||
| Name | Maintainer | Description |
|
| Name | Maintainer | Description |
|
||||||
|--------------|------------|---------------------------------------------------------------------------------------------------------------|
|
|-------------|------------|---------------------------------------------------------------------------------------------------------------|
|
||||||
| langext | Mike | General uttility/helper functions, (everything thats missing from go standard library) |
|
| langext | Mike | General uttility/helper functions, (everything thats missing from go standard library) |
|
||||||
| mathext | Mike | Utility/Helper functions for math |
|
| mathext | Mike | Utility/Helper functions for math |
|
||||||
| cryptext | Mike | Utility/Helper functions for encryption |
|
| cryptext | Mike | Utility/Helper functions for encryption |
|
||||||
| syncext | Mike | Utility/Helper funtions for multi-threading / mutex / channels |
|
| syncext | Mike | Utility/Helper funtions for multi-threading / mutex / channels |
|
||||||
| dataext | Mike | Various useful data structures |
|
| dataext | Mike | Various useful data structures |
|
||||||
| zipext | Mike | Utility for zip/gzip/tar etc |
|
| zipext | Mike | Utility for zip/gzip/tar etc |
|
||||||
| reflectext | Mike | Utility for golagn reflection |
|
| reflectext | Mike | Utility for golang reflection |
|
||||||
|
| fsext | Mike | Utility for filesytem access |
|
||||||
| | | |
|
| | | |
|
||||||
| mongoext | Mike | Utility/Helper functions for mongodb |
|
| mongoext | Mike | Utility/Helper functions for mongodb |
|
||||||
| cursortoken | Mike | MongoDB cursortoken implementation |
|
| cursortoken | Mike | MongoDB cursortoken implementation |
|
||||||
|
36
fsext/exists.go
Normal file
36
fsext/exists.go
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
package fsext
|
||||||
|
|
||||||
|
import "os"
|
||||||
|
|
||||||
|
func PathExists(fp string) (bool, error) {
|
||||||
|
_, err := os.Stat(fp)
|
||||||
|
if err == nil {
|
||||||
|
return true, nil
|
||||||
|
}
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func FileExists(fp string) (bool, error) {
|
||||||
|
stat, err := os.Stat(fp)
|
||||||
|
if err == nil {
|
||||||
|
return !stat.IsDir(), nil
|
||||||
|
}
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
return false, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func DirectoryExists(fp string) (bool, error) {
|
||||||
|
stat, err := os.Stat(fp)
|
||||||
|
if err == nil {
|
||||||
|
return stat.IsDir(), nil
|
||||||
|
}
|
||||||
|
if os.IsNotExist(err) {
|
||||||
|
return false, nil
|
||||||
|
}
|
||||||
|
return false, err
|
||||||
|
}
|
2
go.mod
2
go.mod
@ -25,7 +25,7 @@ require (
|
|||||||
github.com/goccy/go-json v0.10.2 // indirect
|
github.com/goccy/go-json v0.10.2 // indirect
|
||||||
github.com/golang/snappy v0.0.4 // indirect
|
github.com/golang/snappy v0.0.4 // indirect
|
||||||
github.com/json-iterator/go v1.1.12 // indirect
|
github.com/json-iterator/go v1.1.12 // indirect
|
||||||
github.com/klauspost/compress v1.17.1 // indirect
|
github.com/klauspost/compress v1.17.2 // indirect
|
||||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||||
github.com/leodido/go-urn v1.2.4 // indirect
|
github.com/leodido/go-urn v1.2.4 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
|
2
go.sum
2
go.sum
@ -49,6 +49,8 @@ github.com/klauspost/compress v1.17.0 h1:Rnbp4K9EjcDuVuHtd0dgA4qNuv9yKDYKK1ulpJw
|
|||||||
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
github.com/klauspost/compress v1.17.0/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||||
github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g=
|
github.com/klauspost/compress v1.17.1 h1:NE3C767s2ak2bweCZo3+rdP4U/HoyVXLv/X9f2gPS5g=
|
||||||
github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
github.com/klauspost/compress v1.17.1/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||||
|
github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4=
|
||||||
|
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
|
||||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
|
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
|
||||||
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
package goext
|
package goext
|
||||||
|
|
||||||
const GoextVersion = "0.0.288"
|
const GoextVersion = "0.0.289"
|
||||||
|
|
||||||
const GoextVersionTimestamp = "2023-10-19T14:16:01+0200"
|
const GoextVersionTimestamp = "2023-10-26T11:29:08+0200"
|
||||||
|
Loading…
Reference in New Issue
Block a user