{"id":16218061,"url":"https://github.com/quasilyte/inltest","last_synced_at":"2025-03-19T10:30:51.882Z","repository":{"id":57479700,"uuid":"158089939","full_name":"quasilyte/inltest","owner":"quasilyte","description":"Package inltest helps you to test that performance-sensitive funcs are inlineable.","archived":false,"fork":false,"pushed_at":"2018-11-30T09:18:42.000Z","size":10,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T17:57:09.769Z","etag":null,"topics":["go","golang","inline","inlining","library","performance","testing"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/quasilyte.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-18T14:04:15.000Z","updated_at":"2021-09-23T12:36:21.000Z","dependencies_parsed_at":"2022-09-26T17:41:29.023Z","dependency_job_id":null,"html_url":"https://github.com/quasilyte/inltest","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Finltest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Finltest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Finltest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/quasilyte%2Finltest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/quasilyte","download_url":"https://codeload.github.com/quasilyte/inltest/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243982182,"owners_count":20378605,"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":["go","golang","inline","inlining","library","performance","testing"],"created_at":"2024-10-10T11:48:23.963Z","updated_at":"2025-03-19T10:30:51.628Z","avatar_url":"https://github.com/quasilyte.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/Quasilyte/inltest)](https://goreportcard.com/report/github.com/Quasilyte/inltest)\n[![GoDoc](https://godoc.org/github.com/Quasilyte/inltest?status.svg)](https://godoc.org/github.com/Quasilyte/inltest)\n[![Build Status](https://travis-ci.org/Quasilyte/inltest.svg?branch=master)](https://travis-ci.org/Quasilyte/inltest)\n\n# inltest\n\nPackage inltest helps you to test that performance-sensitive funcs are inlineable.\n\nUsually should be used inside your tests, so you can see that some functions are\nnot inlineable anymore due to, for example, cost increase during the last refactoring.\n\n\u003e Note: please don't try to interpret returned \"not inlined resons\" slice.\n\u003e Its contents may change from one Go version to another.\n\u003e The only information you can safely rely on is whether function\n\u003e is inlineable or not. And usually you want all functions from the\n\u003e input map to be inlineable (otherwise why would you include them)?\n\n## Installation\n\n```bash\ngo get -v github.com/Quasilyte/inltest\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/Quasilyte/inltest\"\n)\n\nfunc main() {\n\tissues, err := inltest.CheckInlineable(map[string][]string{\n\t\t\"github.com/Quasilyte/inltest\": {\n\t\t\t\"CheckInlineable\",\n\t\t\t\"nonexisting\",\n\t\t},\n\n\t\t// errors.New is inlineable =\u003e gives no issue.\n\t\t\"errors\": {\n\t\t\t\"New\",\n\t\t},\n\n\t\t\"strings\": {\n\t\t\t\"(*Builder).WriteRune\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"inltest failed: %v\", err)\n\t}\n\tfor _, issue := range issues {\n\t\tfmt.Println(issue)\n\t}\n}\n```\n\nFor tests, you can do something like:\n\n```go\nfunc TestInlining(t *testing.T) {\n\tif testing.Short() {\n\t\tt.Skip(\"skipping in short mode\")\n\t}\n\tissues, err := CheckInlineable(map[string][]string{\n\t\t\"my/important/pkg\": {\n\t\t\t\"func1\",\n\t\t\t\"func2\",\n\t\t\t\"(*Value).Set\",\n\t\t},\n\t})\n\tif err != nil {\n\t\tt.Fatalf(\"inltest failed: %v\", err)\n\t}\n\tfor _, issue := range issues {\n\t\tt.Error(issue)\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Finltest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquasilyte%2Finltest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquasilyte%2Finltest/lists"}