初级会员
  • 第 27757 位会员
  • miaozilong
  • miaozilong
  • 2018-12-25 08:54:04
  • Offline
  • 19 84

最近发布的文章

    暂无

最近分享的资源

    暂无

最近发布的项目

    暂无

最近的评论

  • 评论了主题 请问如何重构代码
    ``` func (this *Item) transfer(accountType string, money float64, note string) { var account Item account.accountType = accountType account.money = money account.note = note balance += account.money account.balance = balance accounts = append(accounts, account) } func (this *Item) Push(money float64, note string) { this.transfer("存入", money, note) } func (this *Item) Pull(money float64, note string) { this.transfer("支出", -money, note) } ``` 这样应该可以的
  • 评论了主题 请问如何重构代码
    ``` func (this *Account) Push(money float64, note string) { var account Account account.accountType = "收入" account.money = money account.note = note account.balance += account.money accounts = append(accounts, account) } func (this *Account) Pull(money float64, note string) { var account Account account.accountType = "支出" account.money = money account.note = note account.balance -= account.money accounts = append(accounts, account) } ```
  • 评论了主题 请问如何重构代码
    `` func (this *Account) Push(money float64, note string) { var account Account account.accountType = "收入" account.money = money account.note = note account.balance += account.money accounts = append(accounts, account) } func (this *Account) Pull(money float64, note string) { var account Account account.accountType = "支出" account.money = money account.note = note account.balance -= account.money accounts = append(accounts, account) }
  • 北京 待遇 15~30k golang 招到了人至少得有10K奖励吧