go-gorp/gorp

If there is a default value for the tag, it will always be inserted.

kemokemo opened this issue · 0 comments

Procedure and issue

This is a sample.

  1. Insert
err = dbmap.Insert(&Comment{Name: "bob", Text: "Hello"})
  1. Instead of “bob” specified at the time of Insert, “No Name” specified as a default value by a tag is inserted into Name.

スクリーンショット 2019-11-03 23 13 36

Environment

My operating environment is as follows.

  • OS: macOS Catalina 10.15.1
  • Go: Ver. 1.13.4
  • gorp: 03c0a1b
  • DB: PostgreSQL Ver. 12.0-2 on docker

Memo

This behavior seems to be related to the #209 .