gitlab.com/apertussolutions/u-root@v7.0.0+incompatible/cmds/core/elvish/edit/api_utils.go (about)

     1  package edit
     2  
     3  // Trivial utilities for the elvishscript API.
     4  
     5  import (
     6  	"fmt"
     7  
     8  	"github.com/u-root/u-root/cmds/core/elvish/util"
     9  )
    10  
    11  func throw(e error) {
    12  	util.Throw(e)
    13  }
    14  
    15  func maybeThrow(e error) {
    16  	if e != nil {
    17  		util.Throw(e)
    18  	}
    19  }
    20  
    21  func throwf(format string, args ...interface{}) {
    22  	util.Throw(fmt.Errorf(format, args...))
    23  }