การตั้งค่า json template Goland

ถ้าใช้ default ของ goland จะเป็น snakeCase()แต่ถ้าอ่านคู่มือ golang จะแนะนำให้ทำเป็น camelCase() มันเลยน่าเบื่อมากที่ พอ json… แล้วดันได้ snakeCase แล้วต้องมาแก้มือประจำ เรามาตั้งค่า auto กันแต่แรกเลยดีกว่า ไปที่ setting >> Live Templates >> Go หรือ Go Struct Tags >> Edit variables >> เปลี่ยนจาก snakeCase(fieldName()) เป็น camelCase(fieldName()) >> Apply >> OK

kreangkrai supchid

February 23, 2021