摘要:
golang 中本身不支持三目运算,如果想要简化代码,可以自定义一个三目运算的函数,通过函数的调用来实现三目运算 package main import ( "fmt" ) // 三目运算的函数 func ternary(a bool, b, c interface{}) interface{} { 阅读全文
posted @ 2021-08-22 16:17
GetcharZp
阅读(2548)
评论(0)
推荐(0)
摘要:
  
评论(0)
推荐(0)
摘要:
package main import ( "fmt" "errors" ) type Stack []int // 入栈 func (s *Stack) push(a int) { *s = append(*s, a) } // 出栈 func (s *Stack) pop() (int, err 阅读全文
posted @ 2021-08-22 00:29
GetcharZp
阅读(206)
评论(0)
推荐(0)

浙公网安备 33010602011771号