本文整理匯總了Golang中github.com/aymerick/raymond.Options.Fn方法的典型用法代碼示例。如果您正苦於以下問題:Golang Options.Fn方法的具體用法?Golang Options.Fn怎麽用?Golang Options.Fn使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/aymerick/raymond.Options
的用法示例。
在下文中一共展示了Options.Fn方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: isSuccess
// isSuccess is a helper function that executes a block iff the status
// is success, else it executes the else block.
func isSuccess(conditional bool, options *raymond.Options) string {
if !conditional {
return options.Inverse()
}
switch options.ParamStr(0) {
case "success":
return options.Fn()
default:
return options.Inverse()
}
}
示例2: isFailure
// isFailure is a helper function that executes a block iff the status
// is a form of failure, else it executes the else block.
func isFailure(conditional bool, options *raymond.Options) string {
if !conditional {
return options.Inverse()
}
switch options.ParamStr(0) {
case "failure", "error", "killed":
return options.Fn()
default:
return options.Inverse()
}
}
示例3: urlencode
func urlencode(options *raymond.Options) string {
return url.QueryEscape(options.Fn())
}
示例4: formHelper
func formHelper(options *raymond.Options) string {
return "<form>" + options.Fn() + "</form>"
}
示例5: rawThreeHelper
func rawThreeHelper(a, b, c string, options *raymond.Options) string {
return options.Fn() + a + b + c
}
示例6: rawHelper
func rawHelper(options *raymond.Options) string {
return options.Fn()
}