Initial commit with cru (no delete) of notes
This commit is contained in:
commit
1e1174f9ca
11 changed files with 244 additions and 0 deletions
30
internal/conf/conf.go
Normal file
30
internal/conf/conf.go
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
package conf
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/pelletier/go-toml"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Extension string
|
||||
NotesDir string
|
||||
TemplatesDir string
|
||||
}
|
||||
|
||||
var Conf Config
|
||||
|
||||
func LoadConfig(path string) {
|
||||
var err error
|
||||
|
||||
b, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
||||
err = toml.Unmarshal([]byte(b), &Conf)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue