github.com/oarkflow/log@v1.0.78/fqdn/util_win.go (about)

     1  //go:build windows
     2  // +build windows
     3  
     4  package fqdn
     5  
     6  func chomp(s string) string {
     7  	if len(s) > 0 && s[len(s)-1] == '\n' {
     8  		s = s[:len(s)-1]
     9  	}
    10  
    11  	if len(s) > 0 && s[len(s)-1] == '\r' {
    12  		s = s[:len(s)-1]
    13  	}
    14  
    15  	return s
    16  }