go一些实用库

   

map分段存储          go get -u github.com/streamrail/concurrent-map            

xlsx库                  go get -u github.com/tealeg/xlsx   

 

 

package main

import (
	"fmt"
	"github.com/tealeg/xlsx"
)

func main() {
	excelFileName := "./excelsrc.xlsx"
	xlFile, err := xlsx.OpenFile(excelFileName)
	if err != nil {
		fmt.Println("open file error", excelFileName, err)
	}
	for _, sheet := range xlFile.Sheets {
		for rownum, row := range sheet.Rows{
			if len(row.Cells) <= 0 {
				continue
			}
			var strrow string
			for _,cell := range row.Cells {
				strrow += " " + cell.String()
			}
			fmt.Println(rownum, row, len(row.Cells))
		}
	}
}

 

你可能感兴趣的:(go学习)