Skip to content

verniyyy/extend-types-go

Repository files navigation

extend-types-go

Supporting your object-oriented programming and, providing extended objects inheriting from built-in types.

Extended objects are immutable, and implemented methods are non-destructive. They implement typecast methods and several utility methods, reducing the need to define value objects of the underlying type.

Also, list is a defined type of slice that uses generics and implements a set of methods based on Ruby Array Class.

Installation

go get -u github.com/verniyyy/extend-types-go

Usage

type MyString struct{ types.Str }

func NewMyString(s string) MyString {
	return MyString{types.NewStr(s)}
}

func main() {
  myString := NewMyString("foo")
  _ = myString.Value() // get raw value
  _ = myString.Validate() // returning nil
}

Contributing

This was originally an implementation for myself, but I am currently in the process of experimentally releasing it as OSS. I am a beginner in OSS development, and there may be various insufficient elements. So contributions are most welcome.

Reporting Issues

Please report issues using the Issues tab at the top of this page.

Pull Requests

If you modify the code please submit a pull request for review.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages