MCPcopy
hub / github.com/qax-os/excelize / GetCellType

Method GetCellType

cell.go:84–97  ·  view source on GitHub ↗

GetCellType provides a function to get the cell's data type by given worksheet name and cell reference in spreadsheet file.

(sheet, cell string)

Source from the content-addressed store, hash-verified

82// GetCellType provides a function to get the cell's data type by given
83// worksheet name and cell reference in spreadsheet file.
84func (f *File) GetCellType(sheet, cell string) (CellType, error) {
85 var (
86 err error
87 cellTypeStr string
88 cellType CellType
89 )
90 if cellTypeStr, err = f.getCellStringFunc(sheet, cell, func(x *xlsxWorksheet, c *xlsxC) (string, bool, error) {
91 return c.T, true, nil
92 }); err != nil {
93 return CellTypeUnset, err
94 }
95 cellType = cellTypes[cellTypeStr]
96 return cellType, err
97}
98
99// SetCellValue provides a function to set the value of a cell. This function
100// is concurrency safe. The specified coordinates should not be in the first

Callers 2

cellResolverMethod · 0.95
TestGetCellTypeFunction · 0.95

Calls 1

getCellStringFuncMethod · 0.95

Tested by 1

TestGetCellTypeFunction · 0.76