replace for with switch in ledis.go