本文整理匯總了Golang中github.com/shuLhan/tabula.DatasetInterface.MergeColumns方法的典型用法代碼示例。如果您正苦於以下問題:Golang DatasetInterface.MergeColumns方法的具體用法?Golang DatasetInterface.MergeColumns怎麽用?Golang DatasetInterface.MergeColumns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/shuLhan/tabula.DatasetInterface
的用法示例。
在下文中一共展示了DatasetInterface.MergeColumns方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: doDiff
/*
doDiff read old and new revisions from edit and compare both of them to get
deletions in old rev and additions in new rev.
Deletions and additions then combined into one string and appended to dataset.
*/
func doDiff(readset dsv.ReaderInterface, ds tabula.DatasetInterface) {
oldids := ds.GetColumnByName("oldrevisionid").ToStringSlice()
newids := ds.GetColumnByName("newrevisionid").ToStringSlice()
revision.SetDir(dRevisions)
diffset, e := revision.Diff(oldids, newids, ".txt")
if e != nil {
panic(e)
}
// Create input metadata for diff
md := dsv.NewMetadata("deletions", "string", ",", "\"", "\"", nil)
readset.AddInputMetadata(md)
md = dsv.NewMetadata("additions", "string", ",", "\"", "\"", nil)
readset.AddInputMetadata(md)
ds.MergeColumns(diffset)
}