30+ results for 'format(args lang:Go' (0 ms)

Not the results you expected?

builtins.go (https://github.com/42wim/matterbridge.git) Go · 611 lines

324 }

325

326 func builtinFormat(args ...Object) (Object, error) {

327 numArgs := len(args)

328 if numArgs == 0 {

log.go (https://github.com/jbardin/gotrace.git) Go · 119 lines

99

100 // Format N number of arguments for logging, and limit the length of each formatted arg.

101 func Format(args ...interface{}) string {

102 parts := make([]string, len(args))

103 for i, arg := range args {

gomod_export.go (https://github.com/qiniu/goplus.git) Go · 577 lines

185 func execmTimeFormat(_ int, p *gop.Context) {

186 args := p.GetArgs(2)

187 ret0 := args[0].(time.Time).Format(args[1].(string))

188 p.Ret(2, ret0)

189 }

191 func execmTimeAppendFormat(_ int, p *gop.Context) {

192 args := p.GetArgs(3)

193 ret0 := args[0].(time.Time).AppendFormat(args[1].([]byte), args[2].(string))

194 p.Ret(3, ret0)

195 }

var_func.go (https://github.com/TeaWeb/build.git) Go · 249 lines

33 }

34 args[0] = types.Float64(args[0])

35 return FuncFormat(args...)

36 }

37

73 // 格式化

74 // format('%.2f')

75 func FuncFormat(args ...interface{}) interface{} {

76 if len(args) == 0 {

77 return ""

godis.go (git://github.com/simonz05/godis.git) Go · 210 lines

147 // Call appends a command to the write buffer or returns an error.

148 func (ac *AsyncClient) Call(args ...interface{}) (err error) {

149 _, err = ac.buf.Write(format(args...))

150 ac.queued++

151 return err

unicode.go (git://github.com/qur/gopy.git) Go · 208 lines

195 }

196

197 func (u *Unicode) Format(args *Tuple) (*Unicode, error) {

198 ret := C.PyUnicode_Format(c(u), c(args))

199 if ret == nil {

commands.go (https://github.com/yezihack/go-mygen.git) Go · 184 lines

81

82 //还可以自定义结构体解析实体,如json,gorm,xml

83 func (c *commands) CustomFormat(args []string) int {

84 formats = c._setFormat()

85 return 0

errors.go (https://github.com/jdcloud-bds/bds.git) Go · 168 lines

163 func (e Error) Panicf(args ...interface{}) {

164 _, fn, line, _ := runtime.Caller(1)

165 errMsg := e.Format(args...).Error()

166 errMsg += "\nCaller was: " + fmt.Sprintf("%s:%d", fn, line)

167 panic(errMsg)

exec.go (https://github.com/merklecounty/rget.git) Go · 143 lines

55 Gen(args []string, dryRun bool) error

56 Lint(args []string, listAllLinters bool, listLinters bool, listAllLintGroups bool, listLintGroup string, diffLintGroups string, generateIgnores bool) error

57 Format(args []string, overwrite, diffMode, lintMode, fix bool) error

58 All(args []string, disableFormat, disableLint, fix bool) error

59 GRPC(args, headers []string, address, method, data, callTimeout, connectTimeout, keepaliveTime string, stdin bool, details bool, tls bool, insecure bool, cacert string, cert string, key string, serverName string) error

fmt.go (https://github.com/MontFerret/ferret.git) Go · 87 lines

28 }

29

30 formatted, err := format(args[0].String(), args[1:])

31 if err != nil {

32 return values.None, err

executor.go (https://github.com/lunarway/shuttle.git) Go · 192 lines

66 var validationErrors []validationError

67

68 namedArgs, parsingErrors := validateArgFormat(args)

69 validationErrors = append(validationErrors, parsingErrors...)

70 if validateArgs {

94 }

95

96 func validateArgFormat(args []string) (map[string]string, []validationError) {

97 var validationErrors []validationError

98 namedArgs := map[string]string{}

format.go (git://github.com/simonz05/godis.git) Go · 95 lines

74 * of strings which create a redis command.

75 * Returns a byte array */

76 func format(args ...interface{}) []byte {

77 buf := make([][]byte, len(args))

78

connection.go (git://github.com/simonz05/godis.git) Go · 115 lines

93 // Write might return a net.Conn.Write error

94 func (c *Conn) Write(args ...interface{}) error {

95 _, e := c.c.Write(format(args...))

96

97 if e != nil {

oci_create_linux.go (https://github.com/sylabs/singularity.git) Go · 81 lines

41 engineConfig.SetBundlePath(absBundle)

42 engineConfig.SetLogPath(args.LogPath)

43 engineConfig.SetLogFormat(args.LogFormat)

44 engineConfig.SetPidFile(args.PidFile)

45

main.go (https://gitlab.com/re-pe/phpApps-Go) Go · 119 lines

36 }

37

38 func CheckFormat(args []interface{}) (format string, hasFormat bool) {

39 if len(args) < 1 { return }

40 switch arg := args[0].(type){

54

55 func Print(args ...interface{}) {

56 if format, hasFormat := CheckFormat(args); hasFormat {

57 fmt.Printf(format, args[1:]...)

58 } else {

62

63 func Log(args ...interface{}) {

64 if format, hasFormat := CheckFormat(args); hasFormat {

65 log.Printf(format, args[1:]...)

66 } else {

page.go (https://github.com/kjk/notionapi.git) Go · 294 lines

87 // SetFormat changes format properties of a page. Valid values are:

88 // page_full_width (bool), page_small_text (bool)

89 func (p *Page) SetFormat(args map[string]interface{}) error {

90 if len(args) == 0 {

91 return errors.New("args can't be empty")

admin-rpc-server.go (https://github.com/pydio/cells.git) Go · 103 lines

82

83 // ReInitFormat - re-init 'format.json'

84 func (receiver *adminRPCReceiver) ReInitFormat(args *ReInitFormatArgs, reply *VoidReply) error {

85 return receiver.local.ReInitFormat(args.DryRun)

funcsStrings.go (https://github.com/zix99/rare.git) Go · 211 lines

130 // {format str args...}

131 // just like fmt.Sprintf

132 func kfFormat(args []KeyBuilderStage) KeyBuilderStage {

133 if len(args) < 1 {

134 return stageError(ErrorArgCount)

template.go (https://github.com/grailbio/reflow.git) Go · 58 lines

46 }

47

48 func (t *template) Format(args ...string) string {

49 s := ""

50 for i := range t.Fragments {

format.go (https://github.com/douyu/jupiter.git) Go · 25 lines

21

22 // Format ...

23 func (fm Formatter) Format(args ...interface{}) string {

24 return fmt.Sprintf(string(fm), args...)

25 }

error.go (https://github.com/beyondblog/k8s-web-terminal.git) Go · 72 lines

19

20 // Format returns a formatted new error based on the arguments

21 func (e *Error) Format(args ...interface{}) error {

22 return fmt.Errorf(e.message, args...)

23 }

54 }

55 _, fn, line, _ := runtime.Caller(1)

56 errMsg := e.Format(args...).Error()

57 errMsg = "\nCaller was: " + fmt.Sprintf("%s:%d", fn, line)

58 panic(errMsg)

notion_import.go (https://github.com/essentialbooks/books.git) Go · 62 lines

28 }

29 logf(" updating format to %v\n", args)

30 err := page.SetFormat(args)

31 if err != nil {

32 logf("updateFormatIfNeeded: page.SetFormat() failed with '%s'\n", err)

host.go (https://github.com/webx-top/echo.git) Go · 117 lines

9 Name() string

10 Alias() string

11 Format(args ...interface{}) string

12 FormatMap(params H) string

13 RegExp() *regexp.Regexp

31 }

32

33 func (h *host) Format(args ...interface{}) string {

34 if len(args) > 0 {

35 return fmt.Sprintf(h.format, args...)

funcsTime.go (https://github.com/zix99/rare.git) Go · 196 lines

125 }

126

127 func kfTimeFormat(args []KeyBuilderStage) KeyBuilderStage {

128 if len(args) < 1 {

129 return stageError(ErrorArgCount)

errors.go (https://github.com/kataras/go-template.git) Go · 102 lines

97 func (e Error) Panicf(args ...interface{}) {

98 _, fn, line, _ := runtime.Caller(1)

99 errMsg := e.Format(args...).Error()

100 errMsg = "\nCaller was: " + fmt.Sprintf("%s:%d", fn, line)

101 panic(errMsg)

connection.go (git://github.com/simonz05/exp-godis.git) Go · 63 lines

44 // write args to socket

45 func (c *Conn) Write(args ...interface{}) error {

46 _, e := c.c.Write(format(args...))

47

48 if e != nil {

string.go (git://github.com/qur/gopy.git) Go · 89 lines

48 }

49

50 func (s *String) Format(args *Tuple) (*String, error) {

51 ret := C.PyString_Format(c(s), c(args))

52 if ret == nil {

echo_host.go (https://github.com/admpub/nging.git) Go · 43 lines

29 r.router = h.Router

30 if len(args) != 1 {

31 r.prefix = h.group.host.Format(args...)

32 return

33 }

38 r.prefix = h.group.host.FormatMap(v)

39 default:

40 r.prefix = h.group.host.Format(args...)

41 }

42 return

godis.go (git://github.com/simonz05/exp-godis.git) Go · 114 lines

80

81 func (ac *AsyncClient) Call(args ...interface{}) (err error) {

82 _, err = ac.buf.Write(format(args...))

83 ac.queued++

84 return err

bettererrors.go (git://github.com/kierdavis/go.git) Go · 23 lines

18 // Function Format runs fmt.Sprintf using the format string specified during creation and the specified

19 // arguments, then returns the created error.

20 func (et ErrorTemplate) Format(args ...interface{}) (err error) {

21 return errors.New(fmt.Sprintf(string(et), args...))

22 }