Skip to content

compiler/natives: Harmless one-byte difference between source and embedded reflect.go. #510

@dmitshur

Description

@dmitshur

While working on #485, I noticed there was a non-zero diff on the embedded reflect.go file when regenerating compiler/natives package.

I've extracted the embedded reflect.go from compiler/natives.FS with:

package main

import (
    "io"
    "os"
)

func main() {
    s, err := natives.FS.Open("/src/reflect/reflect.go")
    if err != nil {
        panic(err)
    }
    defer s.Close()

    d, err := os.Create(".../src/github.com/gopherjs/gopherjs/compiler/natives/src/reflect/reflect2.go")
    if err != nil {
        panic(err)
    }
    defer d.Close()

    _, err = io.Copy(d, s)
    if err != nil {
        panic(err)
    }
}

And confirmed that the difference is harmless, it's just a one byte whitespace difference:

image

--- reflect.go  2016-09-05 21:40:28.000000000 -0700
+++ reflect2.go 2016-09-05 22:15:57.000000000 -0700
@@ -62,7 +62,7 @@
                }
            }
            ut := &uncommonType{
-               pkgPath:  newNameOff(newName(internalStr(typ.Get("pkg")), "", "", false)),
+               pkgPath: newNameOff(newName(internalStr(typ.Get("pkg")), "", "", false)),
                mcount:   uint16(methodSet.Length()),
                _methods: reflectMethods,
            }

I don't think it's worth resolving by regenerating that file now, let's just wait until the next time it changes for other reasons.

I wanted to open and report this so we know that issue exists and is harmless. /cc @neelance

I can see this must've been caused by compiler/natives package being generated before 3ed8536 was applied.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions