From 1934c3475a0d06a16018bf991fc98c9f8c98b246 Mon Sep 17 00:00:00 2001 From: raj_mathe Date: Thu, 4 Nov 2021 11:38:43 +0100 Subject: [PATCH] master > master: code go - methode -> private, da nur intern im package run gebraucht --- .../endpoints/run/run_actions_algorithms.go | 38 +++++++++---------- .../internal/endpoints/run/run_prompts.go | 6 +-- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/code/golang/internal/endpoints/run/run_actions_algorithms.go b/code/golang/internal/endpoints/run/run_actions_algorithms.go index 7b5ae7d..b01f1ec 100644 --- a/code/golang/internal/endpoints/run/run_actions_algorithms.go +++ b/code/golang/internal/endpoints/run/run_actions_algorithms.go @@ -22,13 +22,13 @@ import ( * ---------------------------------------------------------------- */ func actionAlgorithmSearchBinary() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{ + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{ "muss aufsteigend sortiert sein", }) if cancel || err != nil { return cancel, err } - input_x, cancel, err := PromptInputInteger("x", "Suchwert", []string{}) + input_x, cancel, err := promptInputInteger("x", "Suchwert", []string{}) if cancel || err != nil { return cancel, err } @@ -42,14 +42,14 @@ func actionAlgorithmSearchBinary() (bool, error) { } func actionAlgorithmSearchInterpolation() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{ + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{ "muss aufsteigend sortiert sein", "sollte (idealerweise) nicht uniform verteilt sein", }) if cancel || err != nil { return cancel, err } - input_x, cancel, err := PromptInputInteger("x", "Suchwert", []string{}) + input_x, cancel, err := promptInputInteger("x", "Suchwert", []string{}) if cancel || err != nil { return cancel, err } @@ -63,11 +63,11 @@ func actionAlgorithmSearchInterpolation() (bool, error) { } func actionAlgorithmSearchIthElement() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{}) + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{}) if cancel || err != nil { return cancel, err } - input_i, cancel, err := PromptInputInteger("i", "Suchindex in sortierter Liste", []string{ + input_i, cancel, err := promptInputInteger("i", "Suchindex in sortierter Liste", []string{ "sollte zw. 1 und len(L) liegen", }) if cancel || err != nil { @@ -83,11 +83,11 @@ func actionAlgorithmSearchIthElement() (bool, error) { } func actionAlgorithmSearchIthElementDc() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{}) + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{}) if cancel || err != nil { return cancel, err } - input_i, cancel, err := PromptInputInteger("i", "Suchindex in sortierter Liste", []string{ + input_i, cancel, err := promptInputInteger("i", "Suchindex in sortierter Liste", []string{ "sollte zw. 1 und len(L) liegen", }) if cancel || err != nil { @@ -103,7 +103,7 @@ func actionAlgorithmSearchIthElementDc() (bool, error) { } func actionAlgorithmSearchJump() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{ + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{ "muss aufsteigend sortiert sein", "sollte (idealerweise) nicht uniform verteilt sein", "sollte (idealerweise) keine Duplikate enthalten", @@ -111,11 +111,11 @@ func actionAlgorithmSearchJump() (bool, error) { if cancel || err != nil { return cancel, err } - input_x, cancel, err := PromptInputInteger("x", "Suchwert", []string{}) + input_x, cancel, err := promptInputInteger("x", "Suchwert", []string{}) if cancel || err != nil { return cancel, err } - input_m, cancel, err := PromptInputInteger("m", "Sprunggröße", []string{ + input_m, cancel, err := promptInputInteger("m", "Sprunggröße", []string{ "sollte >= 2 sein", }) if cancel || err != nil { @@ -131,7 +131,7 @@ func actionAlgorithmSearchJump() (bool, error) { } func actionAlgorithmSearchJumpExp() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{ + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{ "muss aufsteigend sortiert sein", "sollte (idealerweise) nicht uniform verteilt sein", "sollte (idealerweise) keine Duplikate enthalten", @@ -139,7 +139,7 @@ func actionAlgorithmSearchJumpExp() (bool, error) { if cancel || err != nil { return cancel, err } - input_x, cancel, err := PromptInputInteger("x", "Suchwert", []string{}) + input_x, cancel, err := promptInputInteger("x", "Suchwert", []string{}) if cancel || err != nil { return cancel, err } @@ -153,7 +153,7 @@ func actionAlgorithmSearchJumpExp() (bool, error) { } func actionAlgorithmSearchPoison() (bool, error) { - input_L, cancel, err := PromptInputListOfZeroOnes("L", "Liste von Werten", []string{ + input_L, cancel, err := promptInputListOfZeroOnes("L", "Liste von Werten", []string{ "muss genau eine 1 enthalten", }) if cancel || err != nil { @@ -169,7 +169,7 @@ func actionAlgorithmSearchPoison() (bool, error) { } func actionAlgorithmSearchPoisonFast() (bool, error) { - input_L, cancel, err := PromptInputListOfZeroOnes("L", "Liste von Getränken", []string{ + input_L, cancel, err := promptInputListOfZeroOnes("L", "Liste von Getränken", []string{ "muss genau eine 1 enthalten", }) if cancel || err != nil { @@ -185,11 +185,11 @@ func actionAlgorithmSearchPoisonFast() (bool, error) { } func actionAlgorithmSearchSequential() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{}) + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{}) if cancel || err != nil { return cancel, err } - input_x, cancel, err := PromptInputInteger("x", "Suchwert", []string{}) + input_x, cancel, err := promptInputInteger("x", "Suchwert", []string{}) if cancel || err != nil { return cancel, err } @@ -203,7 +203,7 @@ func actionAlgorithmSearchSequential() (bool, error) { } func actionAlgorithmSumMaxsub() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{}) + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{}) if cancel || err != nil { return cancel, err } @@ -217,7 +217,7 @@ func actionAlgorithmSumMaxsub() (bool, error) { } func actionAlgorithmSumMaxsubDc() (bool, error) { - input_L, cancel, err := PromptInputListOfInt("L", "Liste von Werten", []string{}) + input_L, cancel, err := promptInputListOfInt("L", "Liste von Werten", []string{}) if cancel || err != nil { return cancel, err } diff --git a/code/golang/internal/endpoints/run/run_prompts.go b/code/golang/internal/endpoints/run/run_prompts.go index f339e6e..08c7edb 100644 --- a/code/golang/internal/endpoints/run/run_prompts.go +++ b/code/golang/internal/endpoints/run/run_prompts.go @@ -12,7 +12,7 @@ import ( * CUSTOM PROMPTS für besondere Inputs * ---------------------------------------------------------------- */ -func PromptInputInteger(name string, descr string, requirements []string) (int, bool, error) { +func promptInputInteger(name string, descr string, requirements []string) (int, bool, error) { type responseType struct { Response int `yaml:"response"` } @@ -28,7 +28,7 @@ func PromptInputInteger(name string, descr string, requirements []string) (int, return response.Response, cancel, err } -func PromptInputListOfInt(name string, descr string, requirements []string) ([]int, bool, error) { +func promptInputListOfInt(name string, descr string, requirements []string) ([]int, bool, error) { type responseType struct { Response []int `yaml:"response"` } @@ -48,7 +48,7 @@ func PromptInputListOfInt(name string, descr string, requirements []string) ([]i return response.Response, cancel, err } -func PromptInputListOfZeroOnes(name string, descr string, requirements []string) ([]int, bool, error) { +func promptInputListOfZeroOnes(name string, descr string, requirements []string) ([]int, bool, error) { var values = []int{} type responseType struct { Response []uint8 `yaml:"response"`