{"action":"created","issue":{"url":"https://api.github.com/repos/olekukonko/tablewriter/issues/20","labels_url":"https://api.github.com/repos/olekukonko/tablewriter/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/olekukonko/tablewriter/issues/20/comments","events_url":"https://api.github.com/repos/olekukonko/tablewriter/issues/20/events","html_url":"https://github.com/olekukonko/tablewriter/issues/20","id":116224292,"number":20,"title":"feature request: []string to []interface{}","user":{"login":"kylewolfe","id":5065665,"avatar_url":"https://avatars.githubusercontent.com/u/5065665?v=3","gravatar_id":"","url":"https://api.github.com/users/kylewolfe","html_url":"https://github.com/kylewolfe","followers_url":"https://api.github.com/users/kylewolfe/followers","following_url":"https://api.github.com/users/kylewolfe/following{/other_user}","gists_url":"https://api.github.com/users/kylewolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/kylewolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylewolfe/subscriptions","organizations_url":"https://api.github.com/users/kylewolfe/orgs","repos_url":"https://api.github.com/users/kylewolfe/repos","events_url":"https://api.github.com/users/kylewolfe/events{/privacy}","received_events_url":"https://api.github.com/users/kylewolfe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-11-10T23:14:10Z","updated_at":"2015-11-11T23:55:01Z","closed_at":null,"body":"Append([]string) -> Append([]interface{}) This allows much more fluid table writes.\r\n\r\nGiven:\r\n ```go\r\nfoo := struct{\r\n    Foo   string\r\n    Fizz   int\r\n    Buzz float32\r\n}{\r\n   Foo: \"bar\",\r\n   Fizz: 123,\r\n   Buzz: 3.14,\r\n}\r\ntw := tablewriter.NewWriter(os.Stdout)\r\ntw.SetHeader([]string{\"foo\", \"fizz\", \"buzz\"})\r\n```\r\nthis allows for\r\n```go\r\ntw.Append([]interface{}{\r\n  foo.Foo,\r\n  foo.Fizz,\r\n  foo.Buzz,\r\n})\r\n```\r\n\r\nrather than\r\n```go\r\ntw.Append([]string{}{\r\n  foo.Foo,\r\n  strconv.Itoa(foo.Fizz),\r\n  strconv.FormatFloat(foo.Buzz, 'f', 2, 64),\r\n})\r\n```\r\n\r\nThis can be achieved easily by leveraging fmt.Sprint. This will cause an API break, however. All code utilizing tablewriter would require Append([]string{}) to be converted to Append([]interface{}{}).\r\n\r\nI'll begin a branch with this change. If you do not want to break API, then I can a new method call AppendInterface or something of that nature."},"comment":{"url":"https://api.github.com/repos/olekukonko/tablewriter/issues/comments/155948151","html_url":"https://github.com/olekukonko/tablewriter/issues/20#issuecomment-155948151","issue_url":"https://api.github.com/repos/olekukonko/tablewriter/issues/20","id":155948151,"user":{"login":"kylewolfe","id":5065665,"avatar_url":"https://avatars.githubusercontent.com/u/5065665?v=3","gravatar_id":"","url":"https://api.github.com/users/kylewolfe","html_url":"https://github.com/kylewolfe","followers_url":"https://api.github.com/users/kylewolfe/followers","following_url":"https://api.github.com/users/kylewolfe/following{/other_user}","gists_url":"https://api.github.com/users/kylewolfe/gists{/gist_id}","starred_url":"https://api.github.com/users/kylewolfe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kylewolfe/subscriptions","organizations_url":"https://api.github.com/users/kylewolfe/orgs","repos_url":"https://api.github.com/users/kylewolfe/repos","events_url":"https://api.github.com/users/kylewolfe/events{/privacy}","received_events_url":"https://api.github.com/users/kylewolfe/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T23:55:01Z","updated_at":"2015-11-11T23:55:01Z","body":"Keep in mind, you'd essentially be picking up the behaviour of the standard fmt package. This behaviour is acceptable for that package in order to allow for a less verbose API. People are usually already well versed with the fmt package and will understand the behaviour, so long as you have it documented on your readme.\r\n\r\nIf you do not feel comfortable with this, I can continue to wrap my calls to Append() with a iToString() call."}}