Some decisions regarding the lua env
it will be in the app environment because it serves the app, will think about it later
This commit is contained in:
@@ -4,10 +4,9 @@ import (
|
||||
"context"
|
||||
"expenses/expenses/db/repository"
|
||||
repo "expenses/expenses/db/repository"
|
||||
|
||||
"database/sql"
|
||||
"fmt"
|
||||
|
||||
"encoding/json"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
dec "github.com/shopspring/decimal"
|
||||
)
|
||||
@@ -20,6 +19,15 @@ type Share struct {
|
||||
}
|
||||
type Shares []Share
|
||||
|
||||
// ShareFromJSON takes []byte and returns an *Share
|
||||
func ShareFromJSON(data []byte) (*Share, error) {
|
||||
var share Share
|
||||
|
||||
err := json.Unmarshal(data, &share)
|
||||
|
||||
return &share, err
|
||||
}
|
||||
|
||||
func (sh Shares) Equal(other Shares) bool {
|
||||
if len(sh) != len(other) {
|
||||
return false
|
||||
|
||||
Reference in New Issue
Block a user