Compare commits

...

2 Commits

Author SHA1 Message Date
brian 3db77bc32a adding a changelog 2026-05-06 21:50:37 -06:00
brian 3b84e46c93 now reading from a files directory 2026-05-06 21:50:31 -06:00
4 changed files with 55 additions and 5 deletions
+35
View File
@@ -0,0 +1,35 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- v1.1 German Translation
### Changed
- Use frontmatter title & description in each language version template
### Removed
- Trademark sign previously shown after the project description in version
0.3.0
## [0.0.0] - 2000-01-01
### Added
-
### Changed
-
### Removed
-
View File
View File
+20 -5
View File
@@ -8,13 +8,26 @@ import (
"github.com/joho/godotenv" "github.com/joho/godotenv"
) )
func resolveFileStorePath(path string) { func resolveFileStorePath(file_store_path string) {
err := os.MkdirAll(path, os.ModePerm) err := os.MkdirAll(file_store_path, os.ModePerm)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }
} }
func readFilesFromFileStorePath(file_store_path string) {
files, err := os.ReadDir(file_store_path)
if err != nil {
log.Fatal(err)
}
for _, file := range files {
if !file.IsDir() {
fmt.Println(file.Name())
}
}
}
func main() { func main() {
err := godotenv.Load() err := godotenv.Load()
if err != nil { if err != nil {
@@ -23,10 +36,12 @@ func main() {
port := os.Getenv("PORT") port := os.Getenv("PORT")
storage_path := os.Getenv("STORAGE_PATH") file_store_path := os.Getenv("STORAGE_PATH")
resolveFileStorePath(storage_path) resolveFileStorePath(file_store_path)
fmt.Printf("in the future I will listen on port: %s\n", port) fmt.Printf("in the future I will listen on port: %s\n", port)
fmt.Printf("Reading files from: %s\n", storage_path) fmt.Printf("Reading files from: %s\n", file_store_path)
readFilesFromFileStorePath(file_store_path)
} }