Refactor config usage to access values through Config singleton
This commit is contained in:
@@ -14,7 +14,6 @@ import (
|
|||||||
func main() {
|
func main() {
|
||||||
// Setup config
|
// Setup config
|
||||||
config.Init()
|
config.Init()
|
||||||
var config = config.Load()
|
|
||||||
|
|
||||||
|
|
||||||
// Initialize database
|
// Initialize database
|
||||||
@@ -29,7 +28,7 @@ func main() {
|
|||||||
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
|
||||||
defer cancel()
|
defer cancel()
|
||||||
var posts []domain.Post = nil
|
var posts []domain.Post = nil
|
||||||
err, posts := services.PostServiceInstance.GetPostsFromApi(ctx, config.Tag, config.Instance)
|
err, posts := services.PostServiceInstance.GetPostsFromApi(ctx, config.Config.Tag, config.Config.Instance)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
return
|
return
|
||||||
|
Reference in New Issue
Block a user