mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-28 22:19:59 +02:00
Improve "watching for ..." logging
This commit is contained in:
@@ -90,6 +90,19 @@ func FirstUpper(s string) string {
|
||||
return string(unicode.ToUpper(r)) + s[n:]
|
||||
}
|
||||
|
||||
// UniqueStrings returns a new slice with any duplicates removed.
|
||||
func UniqueStrings(s []string) []string {
|
||||
unique := make([]string, 0)
|
||||
set := map[string]interface{}{}
|
||||
for _, val := range s {
|
||||
if _, ok := set[val]; !ok {
|
||||
unique = append(unique, val)
|
||||
set[val] = val
|
||||
}
|
||||
}
|
||||
return unique
|
||||
}
|
||||
|
||||
// ReaderToBytes takes an io.Reader argument, reads from it
|
||||
// and returns bytes.
|
||||
func ReaderToBytes(lines io.Reader) []byte {
|
||||
|
Reference in New Issue
Block a user