Skip to content
Snippets Groups Projects
Select Git revision
  • 4132c09d965d94d2dfe7c7203a093162bf41fd77
  • master default protected
  • 1.2.4
  • 1.2.3
  • 1.2.2
  • 1.2.1
  • 1.2.0
  • v1.1.0
8 results

07_execute.go

Blame
  • messages.go 939 B
    // Copyright 2023 schukai GmbH
    // SPDX-License-Identifier: AGPL-3.0
    
    package environment
    
    import (
    	"github.com/gookit/color"
    	"gitlab.schukai.com/oss/utilities/documentation-manager/translations"
    	"strings"
    )
    
    func PrintMessages() {
    
    	const indent = "  "
    
    	if len(State.errors) > 0 {
    		color.Error.Println(strings.ToUpper(translations.T.Sprintf("Error")) + ":")
    	}
    
    	for _, message := range State.errors {
    		color.Error.Println(indent + message)
    	}
    
    	if len(State.warnings) > 0 {
    		color.Warn.Println(strings.ToUpper(translations.T.Sprintf("Warn")) + ":")
    	}
    
    	for _, message := range State.warnings {
    		color.Warn.Println(indent + message)
    	}
    
    	if len(State.messages) > 0 {
    		color.Info.Println(strings.ToUpper(translations.T.Sprintf("Info")) + ":")
    	}
    
    	for _, message := range State.messages {
    		color.Info.Println(indent + message)
    	}
    
    	// reset
    	State.messages = []string{}
    	State.warnings = []string{}
    	State.errors = []string{}
    
    }