Skip to content

Tool doesn't handle fixed size arrays at all #31

@jtrac3er

Description

@jtrac3er

When you try to deep-copy the follwing code

package main

type s3 struct {
	Y int
	Z int
}
type s2 struct {
	X      int
	String *byte
	Ps3    *s3
}
type s1 struct {
	ArrayOfS2        [10]s2
	ArrayOfPointerS2 [20]*s2
	PInt             *int
}

then the arrays are simply ommitted...

// generated by /home/ubuntu/go/bin/deep-copy --type s1 build/golang_converted.go; DO NOT EDIT.

package main

// DeepCopy generates a deep copy of s1
func (o s1) DeepCopy() s1 {
	var cp s1 = o
	if o.PInt != nil {
		cp.PInt = new(int)
		*cp.PInt = *o.PInt
	}
	return cp
}

exact command used:

~/go/bin/deep-copy --type s1 arrayStruct.h

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions