set the separator as a var and add it to the context

This commit is contained in:
Alfred Kamanda 2024-12-13 11:38:10 +03:00
parent f38ea59569
commit 64c1fe5276
Signed by untrusted user: Alfred-mk
GPG Key ID: 7EA3D01708908703
4 changed files with 17 additions and 10 deletions

View File

@ -32,8 +32,8 @@ import (
var ( var (
logg = logging.NewVanilla() logg = logging.NewVanilla()
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
build = "dev" build = "dev"
menuSeparator = ": "
) )
func init() { func init() {
@ -128,13 +128,14 @@ func main() {
ctx := context.Background() ctx := context.Background()
ctx = context.WithValue(ctx, "Database", database) ctx = context.WithValue(ctx, "Database", database)
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
pfp := path.Join(scriptDir, "pp.csv") pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{ cfg := engine.Config{
Root: "root", Root: "root",
OutputSize: uint32(size), OutputSize: uint32(size),
FlagCount: uint32(128), FlagCount: uint32(128),
MenuSeparator: ": ", MenuSeparator: menuSeparator,
} }
if engineDebug { if engineDebug {

View File

@ -23,6 +23,7 @@ import (
var ( var (
logg = logging.NewVanilla() logg = logging.NewVanilla()
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
menuSeparator = ": "
) )
func init() { func init() {
@ -67,13 +68,14 @@ func main() {
ctx := context.Background() ctx := context.Background()
ctx = context.WithValue(ctx, "Database", database) ctx = context.WithValue(ctx, "Database", database)
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
pfp := path.Join(scriptDir, "pp.csv") pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{ cfg := engine.Config{
Root: "root", Root: "root",
OutputSize: uint32(size), OutputSize: uint32(size),
FlagCount: uint32(128), FlagCount: uint32(128),
MenuSeparator: ": ", MenuSeparator: menuSeparator,
} }
if engineDebug { if engineDebug {

View File

@ -26,6 +26,7 @@ import (
var ( var (
logg = logging.NewVanilla() logg = logging.NewVanilla()
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
menuSeparator = ": "
) )
func init() { func init() {
@ -55,13 +56,14 @@ func main() {
ctx := context.Background() ctx := context.Background()
ctx = context.WithValue(ctx, "Database", database) ctx = context.WithValue(ctx, "Database", database)
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
pfp := path.Join(scriptDir, "pp.csv") pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{ cfg := engine.Config{
Root: "root", Root: "root",
OutputSize: uint32(size), OutputSize: uint32(size),
FlagCount: uint32(128), FlagCount: uint32(128),
MenuSeparator: ": ", MenuSeparator: menuSeparator,
} }
if engineDebug { if engineDebug {

View File

@ -20,6 +20,7 @@ import (
var ( var (
logg = logging.NewVanilla() logg = logging.NewVanilla()
scriptDir = path.Join("services", "registration") scriptDir = path.Join("services", "registration")
menuSeparator = ": "
) )
func init() { func init() {
@ -46,6 +47,7 @@ func main() {
ctx := context.Background() ctx := context.Background()
ctx = context.WithValue(ctx, "SessionId", sessionId) ctx = context.WithValue(ctx, "SessionId", sessionId)
ctx = context.WithValue(ctx, "Database", database) ctx = context.WithValue(ctx, "Database", database)
ctx = context.WithValue(ctx, "MenuSeparator", menuSeparator)
pfp := path.Join(scriptDir, "pp.csv") pfp := path.Join(scriptDir, "pp.csv")
cfg := engine.Config{ cfg := engine.Config{
@ -53,7 +55,7 @@ func main() {
SessionId: sessionId, SessionId: sessionId,
OutputSize: uint32(size), OutputSize: uint32(size),
FlagCount: uint32(128), FlagCount: uint32(128),
MenuSeparator: ": ", MenuSeparator: menuSeparator,
} }
resourceDir := scriptDir resourceDir := scriptDir