Skip to content

Go. Support for all user-defined types #2056

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 4, 2023

Conversation

egiptipavel
Copy link
Collaborator

Description

Added support for all user-defined types. Previously, only the structures and interface of errors were supported.

How to test

Manual tests

type Type byte

func NamedType(n Type) Type {
	return n
}

func ArrayOfNamedType(array [5]Type) [5]Type {
	return array
}

type T [5][5]Type

func ArrayOfArrayOfNamedType(array [5][5]Type) T {
	return array
}

func SliceOfNamedType(slice []Type) []Type {
	return slice
}

type NA [5]uintptr

func NamedArray(array NA) NA {
	return array
}

type NS []int

func NamedSlice(slice NS) NS {
	return slice
}

type S struct {
	t Type
	T
	n NA
	NS
}

func StructWithFieldsOfNamedTypes(s S) S {
	return s
}

Self-check list

Check off the item if the statement is true. Hint: [x] is a marked item.

Please do not delete the list or its items.

  • I've set the proper labels for my PR (at least, for category and component).
  • PR title and description are clear and intelligible.
  • I've added enough comments to my code, particularly in hard-to-understand areas.
  • The functionality I've repaired, changed or added is covered with automated tests.
  • Manual tests have been provided optionally.
  • The documentation for the functionality I've been working on is up-to-date.

@egiptipavel egiptipavel added ctg-enhancement New feature, improvement or change request lang-go Issue is related to Go support labels Mar 28, 2023
@egiptipavel egiptipavel requested a review from Markoutte March 28, 2023 11:29
@egiptipavel egiptipavel self-assigned this Mar 28, 2023
@egiptipavel egiptipavel merged commit c57cc4b into main Apr 4, 2023
@egiptipavel egiptipavel deleted the egiptipavel/go-named-types-support branch April 4, 2023 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ctg-enhancement New feature, improvement or change request lang-go Issue is related to Go support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants