check ith column should be displayed or not
(showNumL, hideNumL []int, col int)
| 806 | |
| 807 | // check ith column should be displayed or not |
| 808 | func 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 |
no outgoing calls