mirror of
https://github.com/OliveTin/OliveTin
synced 2025-12-16 11:05:32 +00:00
Some checks failed
Build Snapshot / build-snapshot (push) Waiting to run
DevSkim / DevSkim (push) Waiting to run
Buf CI / buf (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Codestyle checks / codestyle (push) Has been cancelled
21 lines
365 B
Go
21 lines
365 B
Go
package filehelper
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
"os"
|
|
)
|
|
|
|
func Touch(filename string, description string) {
|
|
_, err := os.Stat(filename)
|
|
|
|
if os.IsNotExist(err) {
|
|
_, err := os.Create(filename)
|
|
|
|
if err != nil {
|
|
log.Warnf("Could not create %v: %v", description, filename)
|
|
} else {
|
|
log.Infof("Created %v: %v", description, filename)
|
|
}
|
|
}
|
|
}
|