{"id":23692580,"url":"https://github.com/arthurfp/go_flyweight_pattern","last_synced_at":"2026-01-17T09:30:22.672Z","repository":{"id":246715172,"uuid":"821908297","full_name":"arthurfp/Go_Flyweight_Pattern","owner":"arthurfp","description":"A Go project demonstrating the Flyweight pattern with a focus on minimizing memory usage by sharing data among similar objects. This repository showcases best practices in design patterns and unit testing.","archived":false,"fork":false,"pushed_at":"2024-06-29T22:30:11.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-30T03:29:05.861Z","etag":null,"topics":["code-pattern","flyweight","flyweight-pattern","go","golang"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arthurfp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-29T19:34:30.000Z","updated_at":"2024-06-29T22:30:14.000Z","dependencies_parsed_at":null,"dependency_job_id":"e170c0ce-b791-437f-8248-169a3743b2e1","html_url":"https://github.com/arthurfp/Go_Flyweight_Pattern","commit_stats":null,"previous_names":["arthurfp/go_flyweight_pattern"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurfp%2FGo_Flyweight_Pattern","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurfp%2FGo_Flyweight_Pattern/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurfp%2FGo_Flyweight_Pattern/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arthurfp%2FGo_Flyweight_Pattern/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arthurfp","download_url":"https://codeload.github.com/arthurfp/Go_Flyweight_Pattern/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239758828,"owners_count":19692034,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-pattern","flyweight","flyweight-pattern","go","golang"],"created_at":"2024-12-30T03:29:08.499Z","updated_at":"2026-01-17T09:30:22.553Z","avatar_url":"https://github.com/arthurfp.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flyweight Pattern in Go\n\n## Overview\nThis repository demonstrates the application of the Flyweight design pattern in Go. The project highlights how to minimize memory usage by sharing as much data as possible with other similar objects, showcasing flexibility and best practices in design patterns and unit testing.\n\n## Pattern Description\nThe Flyweight pattern is used to minimize memory usage by sharing data among similar objects. This is achieved by storing common data externally and passing it to the objects that need it. In this project, we have implemented the Flyweight pattern using a `FlyweightFactory` to manage and reuse flyweight objects.\n\n## Project Structure\n- **cmd/**: Contains the application entry point (`main.go`), demonstrating the creation and usage of flyweights.\n- **pkg/flyweight/**: Houses the Flyweight implementation.\n  - **flyweight.go**: Defines the `Flyweight` interface.\n  - **concrete_flyweight.go**: Implements the `ConcreteFlyweight`.\n  - **flyweight_factory.go**: Implements the `FlyweightFactory` to create and manage flyweight objects.\n  - **concrete_flyweight_test.go**: Unit tests for `ConcreteFlyweight`.\n  - **flyweight_factory_test.go**: Unit tests for `FlyweightFactory`.\n\n## Getting Started\n\n### Prerequisites\nEnsure you have Go installed on your system. You can download it from [Go's official site](https://golang.org/dl/).\n\n\n### Installation\nClone this repository to your local machine:\n```bash\ngit clone https://github.com/arthurfp/Go_Flyweight_Pattern.git\ncd Go_Flyweight_Pattern\n```\n\n### Running the Application\nTo run the application, execute:\n```bash\ngo run cmd/main.go\n```\n\n### Running the Tests\nTo execute the tests and verify the functionality:\n```bash\ngo test ./...\n```\n\n### Contributing\nContributions are welcome! Please feel free to submit pull requests or open issues to discuss proposed changes or enhancements.\n\n### Author\nArthur Ferreira - github.com/arthurfp","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurfp%2Fgo_flyweight_pattern","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farthurfp%2Fgo_flyweight_pattern","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farthurfp%2Fgo_flyweight_pattern/lists"}