File: replace.tmpl

package info (click to toggle)
golang-github-kshedden-dstream 0.0~git20190512.c4c4106-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 596 kB
  • sloc: makefile: 30
file content (23 lines) | stat: -rw-r--r-- 393 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package dstream

import (
    "fmt"
    "time"
)

func (r *replaceColumn) GetPos(j int) interface{} {

	if j != r.colpos {
		return r.source.GetPos(j)
	}

    switch z := r.coldata.(type) {
        {{- range . }}
            case []{{ .Type }}:
	            return z[r.rowpos:r.rowpos+r.csize]
     	{{- end }}
	default:
	    msg := fmt.Sprintf("unknown type %T\n", z)
        panic(msg)
	}
}