// Copyright 2014 Oleku Konko All rights reserved.// Use of this source code is governed by a MIT// license that can be found in the LICENSE file.// This module is a Table Writer API for the Go Programming Language.// The protocols were written in pure Go and works on windows and unix systemspackage tablewriterimport ()// Start A new table by importing from a CSV file// Takes io.Writer and csv File namefunc ( io.Writer, string, bool) (*Table, error) { , := os.Open()if != nil {return &Table{}, }defer .Close() := csv.NewReader() , := NewCSVReader(, , )return , }// Start a New Table Writer with csv.Reader// This enables customisation such as reader.Comma = ';'// See http://golang.org/src/pkg/encoding/csv/reader.go?s=3213:3671#L94func ( io.Writer, *csv.Reader, bool) (*Table, error) { := NewWriter()if {// Read the first row , := .Read()if != nil {return &Table{}, } .SetHeader() }for { , := .Read()if == io.EOF {break } elseif != nil {return &Table{}, } .Append() }return , nil}
The pages are generated with Goldsv0.8.2. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds.