https://play.golang.org/p/YMfpuluzef

判断结构体是否为空

打印带attribute(key) 的结构体

package main

import (
    "fmt"
)
type  Imp struct {
  Imp  int 
  Dev  string 
 
}

func main() {
   imp := Imp{ }
     //print struct with key
    fmt.Printf("%+v", imp )
    // struct is emputy 
    fmt.Println(imp ==( Imp{}) )
    fmt.Println("Hello, playground")    
}

 

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2021-09-22
  • 2021-05-24
  • 2021-12-07
  • 2021-08-23
  • 2022-12-23
  • 2021-06-14
猜你喜欢
  • 2021-07-20
  • 2022-12-23
  • 2021-09-04
  • 2021-11-17
  • 2021-11-06
  • 2021-10-31
相关资源
相似解决方案