MCPcopy Create free account
hub / github.com/codechenx/FastTableViewer / checkVisible

Function checkVisible

io.go:808–829  ·  view source on GitHub ↗

check ith column should be displayed or not

(showNumL, hideNumL []int, col int)

Source from the content-addressed store, hash-verified

806
807// check ith column should be displayed or not
808func checkVisible(showNumL, hideNumL []int, col int) (bool, error) {
809 if len(showNumL) != 0 && len(hideNumL) != 0 {
810 return false, errors.New("you can only set visible column or hidden column")
811 }
812
813 if len(showNumL) != 0 {
814 for _, colTestS := range showNumL {
815 if col+1 == colTestS {
816 return true, nil
817 }
818 }
819 return false, nil
820 }
821 if len(hideNumL) != 0 {
822 for _, colTestH := range hideNumL {
823 if col+1 == colTestH {
824 return false, nil
825 }
826 }
827 }
828 return true, nil
829}
830
831// use go csv library to parse a string line into csv format
832// Optimized version with reusable reader

Callers 2

getVisColFunction · 0.85
Test_checkVisibleFunction · 0.85

Calls

no outgoing calls

Tested by 1

Test_checkVisibleFunction · 0.68