![](/img/trans.png)
[英]assert: mock: I don't know what to return because the method call was unexpected Error while writing unit test in Go
我在 Go 中使用testify為我的服務方法編寫單元測試,除更新方法外,所有方法都工作正常,因為在更新方法中,我在更新方法中調用了同一服務的另一個方法(“GetByID”)。 在我的服務中實現 Update 方法: 更新的 MockRepo 方法: 測試的實現: 現在,當我運行測試時,出現以下錯 ...