摘要: go的工厂模式是为了解决struct的命名为小写字母开头,在其他模块中不能调用的问题。正常来说只有大写字母开头的函数,结构体,结构体中的字段才能被其他多模块调用 构建工厂模式函数 package module type student struct { Name string Age int } # 阅读全文
posted @ 2023-08-30 16:36 潇潇暮鱼鱼 阅读(58) 评论(0) 推荐(0)