github.com/puellanivis/breton@v0.2.16/lib/files/about/strings.go (about)

     1  package aboutfiles
     2  
     3  import (
     4  	"time"
     5  
     6  	"github.com/puellanivis/breton/lib/os/process"
     7  )
     8  
     9  type stringFunc func() string
    10  
    11  func (f stringFunc) ReadAll() ([]byte, error) {
    12  	return append([]byte(f()), '\n'), nil
    13  }
    14  
    15  var (
    16  	blank   stringFunc = func() string { return "" }
    17  	version stringFunc = func() string { return process.Version() }
    18  	now     stringFunc = func() string { return time.Now().Truncate(0).String() }
    19  )