clean: removed the obsolete functions outputMessage and outputError
This commit is contained in:
@@ -8,9 +8,10 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"gorm.io/gorm"
|
|
||||||
"goyco/internal/config"
|
"goyco/internal/config"
|
||||||
"goyco/internal/database"
|
"goyco/internal/database"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
)
|
)
|
||||||
|
|
||||||
var ErrHelpRequested = errors.New("help requested")
|
var ErrHelpRequested = errors.New("help requested")
|
||||||
@@ -118,26 +119,6 @@ func outputJSON(v interface{}) error {
|
|||||||
return encoder.Encode(v)
|
return encoder.Encode(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
func outputMessage(message string, args ...interface{}) {
|
|
||||||
if IsJSONOutput() {
|
|
||||||
outputJSON(map[string]interface{}{
|
|
||||||
"message": fmt.Sprintf(message, args...),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
fmt.Printf(message+"\n", args...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func outputError(message string, args ...interface{}) {
|
|
||||||
if IsJSONOutput() {
|
|
||||||
outputJSON(map[string]interface{}{
|
|
||||||
"error": fmt.Sprintf(message, args...),
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
fmt.Fprintf(os.Stderr, message+"\n", args...)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func outputWarning(message string, args ...interface{}) {
|
func outputWarning(message string, args ...interface{}) {
|
||||||
if IsJSONOutput() {
|
if IsJSONOutput() {
|
||||||
outputJSON(map[string]interface{}{
|
outputJSON(map[string]interface{}{
|
||||||
|
|||||||
Reference in New Issue
Block a user