Compare commits

...

3 Commits

Author SHA1 Message Date
Thomas Pelletier 3077a406a1 ci: linux/386 2022-09-09 19:58:56 -04:00
Thomas Pelletier 48ca06a23c ci: add tinygo test 2022-09-09 19:58:47 -04:00
Thomas Pelletier 942841787a Fix reflect.Pointer backward compatibility (#813)
Though we don't officially support older versions of Go, this is an easy fix to
unblock people.

Fixes #812
2022-08-26 09:15:03 -04:00
2 changed files with 38 additions and 2 deletions
+36
View File
@@ -0,0 +1,36 @@
# Those tests are allowed to fail. They don't represent an officially supported\
# situation, but rather ones that are nice to have.
name: experimental
on:
# Not ready for merged commits yet.
# push:
# branches:
# - v2
pull_request:
branches:
- v2
jobs:
linux32:
name: linux 386
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup go
uses: actions/setup-go@master
with:
go-version: 1.19
- name: Run unit tests
run: GOARCH=386 go test ./...
tinygo:
name: tinygo 0.25.0
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: tinygo test ./...
run: |
docker run --rm -v $(pwd):/src -w /src tinygo/tinygo:0.25.0 tinygo test ./...
+2 -2
View File
@@ -1140,7 +1140,7 @@ func fieldByIndex(v reflect.Value, path []int) reflect.Value {
for i, x := range path {
v = v.Field(x)
if i < len(path)-1 && v.Kind() == reflect.Pointer {
if i < len(path)-1 && v.Kind() == reflect.Ptr {
if v.IsNil() {
v.Set(reflect.New(v.Type().Elem()))
}
@@ -1208,7 +1208,7 @@ func forEachField(t reflect.Type, path []int, do func(name string, path []int))
if f.Anonymous && name == "" {
t2 := f.Type
if t2.Kind() == reflect.Pointer {
if t2.Kind() == reflect.Ptr {
t2 = t2.Elem()
}