From 250fc80c3c15cd38a518af5c256e2ba619295f5f Mon Sep 17 00:00:00 2001 From: xengineering Date: Mon, 6 May 2024 17:16:54 +0200 Subject: model: Introduce NewStorage() function It is a common pattern inside the Go standard library to provide a constructor with this naming scheme to custom types of the package. Doing this here results in a style closer to the standard library which improves readability. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index d0b0be2..07e1c90 100644 --- a/main.go +++ b/main.go @@ -33,7 +33,7 @@ func main() { config.Read() } - storage := model.Storage{Path: config.StorageFilePath} + storage := model.NewStorage(config.StorageFilePath) if !storage.Exists() { storage.Create() } -- cgit v1.2.3-70-g09d2