MCPcopy Index your code
hub / github.com/codechenx/FastTableViewer / getVisCol

Function getVisCol

io.go:780–805  ·  view source on GitHub ↗

check columns that should be displayed

(showNumL, hideNumL []int, colLen int)

Source from the content-addressed store, hash-verified

778
779// check columns that should be displayed
780func getVisCol(showNumL, hideNumL []int, colLen int) ([]int, error) {
781 for _, i := range showNumL {
782 if i > colLen || i <= 0 {
783 return nil, errors.New("Column number " + I2S(i) + " does not exist")
784 }
785 }
786
787 for _, i := range hideNumL {
788 if i > colLen || i <= 0 {
789 return nil, errors.New("Column number " + I2S(i) + " does not exist")
790 }
791 }
792
793 var visCol []int
794 for i := 0; i < colLen; i++ {
795 flag, err := checkVisible(showNumL, hideNumL, i)
796 if err != nil {
797 return nil, err
798 }
799 if flag {
800 visCol = append(visCol, i)
801 }
802 }
803 return visCol, nil
804
805}
806
807// check ith column should be displayed or not
808func checkVisible(showNumL, hideNumL []int, col int) (bool, error) {

Callers 4

loadFileToBufferAsyncFunction · 0.85
loadPipeToBufferAsyncFunction · 0.85
addDRToBufferFunction · 0.85
Test_getVisColFunction · 0.85

Calls 2

I2SFunction · 0.85
checkVisibleFunction · 0.85

Tested by 1

Test_getVisColFunction · 0.68