摘要: 提问 如何写一个go的HelloWorld 回答 有几个注意点 package package main main包才能有运行main方法 引用 import ( "fmt" "sort" ) main函数 func main() { fmt.Println("HelloWorld") } 运行 g 阅读全文
posted @ 2022-11-01 16:07 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 提问 如何切面记录日志 回答 使用MethodDecorator.Fody using System.Reflection; using my.Attributes; using my.Log4Net; using log4net; using MethodDecorator.Fody.Interf 阅读全文
posted @ 2022-11-01 14:43 喜爱糖葫芦 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 提问 如何获取当前程序集 回答 var assembly = Assembly.GetExecutingAssembly(); 阅读全文
posted @ 2022-11-01 09:29 喜爱糖葫芦 阅读(17) 评论(0) 推荐(0) 编辑
摘要: 提问 如何写出最优美的工厂模式 回答 首先定义什么是最优美 最优美代表着他:面对新增开放,面对修改关闭实践 那么如何实现呢? 我选择使用特性 + 反射 public ICommand? BuildCommand(string[]? args) { if (args == null || args.L 阅读全文
posted @ 2022-11-01 09:28 喜爱糖葫芦 阅读(14) 评论(0) 推荐(0) 编辑