pavedroad-io / roadctl

A kubectl compatible CLI for managing and creating applications and defining/managing CI/CD environments. The roadctl command uses blueprints based on provent design patterns driven by produciton metrics.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Created and Updated fields to generated structs

jscharber opened this issue · comments

The code expects date time stamps for each row. Currently, these are inserted in the YAML instead of being generated automatically. If an end-user forgets them, the code breaks when executed.

We want to modify cmd/templates.go to include them automatically

92 // structUUID
93 // name of table, type of data json|yaml
94 const structUUID = "\t%sUUID string %s:%suuid\n"

... const structCreated = ...
const struct Updated = ...

Note, the JSON field string is also not proper

const structUUID = "\t%sUUID string %s:%suuid\n"

should include quotes like this

const structUUID = "\t%sUUID string %s:**"**%suuid**"**\n"