diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index e99538e..adc999f 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -6,14 +6,14 @@ jobs: test: strategy: matrix: - go-versions: [ 1.14.x, 1.15.x, 1.16.x ] + version: [ '1.15', '1.16', '1.17' ] platform: [ ubuntu-latest, macos-latest, windows-latest ] runs-on: ${{ matrix.platform }} steps: - name: Install Go uses: actions/setup-go@v2 with: - go-version: ${{ matrix.go-version }} + go-version: ${{ matrix.version }} - name: Checkout code uses: actions/checkout@v2 - name: Build diff --git a/funcr/funcr.go b/funcr/funcr.go index b23ab96..166e245 100644 --- a/funcr/funcr.go +++ b/funcr/funcr.go @@ -408,8 +408,9 @@ func (f Formatter) prettyWithFlags(value interface{}, flags uint32, depth int) s if i > 0 { buf.WriteByte(',') } + k, _ := v[i].(string) // sanitize() above means no need to check success // arbitrary keys might need escaping - buf.WriteString(prettyString(v[i].(string))) + buf.WriteString(prettyString(k)) buf.WriteByte(':') buf.WriteString(f.prettyWithFlags(v[i+1], 0, depth+1)) }