{"id":38875342,"url":"https://github.com/apaxa-go/eval","last_synced_at":"2026-01-17T14:35:48.136Z","repository":{"id":53375521,"uuid":"79113044","full_name":"apaxa-go/eval","owner":"apaxa-go","description":"Package eval implements evaluation of GoLang expression at runtime.","archived":false,"fork":false,"pushed_at":"2017-12-23T18:23:30.000Z","size":86,"stargazers_count":57,"open_issues_count":1,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-01-12T11:39:25.940Z","etag":null,"topics":["eval","golang","golang-expression","library"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/apaxa-go.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":"2017-01-16T11:44:33.000Z","updated_at":"2025-04-09T05:21:27.000Z","dependencies_parsed_at":"2022-09-03T06:24:44.161Z","dependency_job_id":null,"html_url":"https://github.com/apaxa-go/eval","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/apaxa-go/eval","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apaxa-go%2Feval","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apaxa-go%2Feval/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apaxa-go%2Feval/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apaxa-go%2Feval/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/apaxa-go","download_url":"https://codeload.github.com/apaxa-go/eval/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/apaxa-go%2Feval/sbom","scorecard":{"id":202064,"data":{"date":"2025-08-11","repo":{"name":"github.com/apaxa-go/eval","commit":"1d18b251d6795e462ef99e1cd2d0c88f64a0918b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-16T22:59:10.950Z","repository_id":53375521,"created_at":"2025-08-16T22:59:10.950Z","updated_at":"2025-08-16T22:59:10.950Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28510022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["eval","golang","golang-expression","library"],"created_at":"2026-01-17T14:35:48.043Z","updated_at":"2026-01-17T14:35:48.127Z","avatar_url":"https://github.com/apaxa-go.png","language":"Go","readme":"# eval\n\n[![Build Status](https://travis-ci.org/apaxa-go/eval.svg?branch=master)](https://travis-ci.org/apaxa-go/eval)\n[![Coverage Status](https://coveralls.io/repos/github/apaxa-go/eval/badge.svg?branch=master)](https://coveralls.io/github/apaxa-go/eval?branch=master) \n[![Go Report Card](https://goreportcard.com/badge/github.com/apaxa-go/eval)](https://goreportcard.com/report/github.com/apaxa-go/eval)\n[![GoDoc](https://godoc.org/github.com/apaxa-go/eval?status.svg)](https://godoc.org/github.com/apaxa-go/eval)\n\nPackage eval implements evaluation of GoLang expression at runtime.\n\n# **THIS LIB NO MORE MAINTAINED!**\n\n# For whose who wants to implement golang eval\nSuggestions:\n1. Implement 2-steps algorithm: first step - analogue of golang compilation (resolve all types; compute all constants; convert all untyped constant and untyped variables to typed; also simplify AST tree here / convert to your own format), second step - analogue of golang runtime (here will be passed values of external variables and computed final result). \n2. You need to use golang eval package, but keep in mind that it can simplify break your lib on update (golang's backward compatibility does not save you).\n3. Follow language specification (it is hard to implement some additional custom behaviour without breaking compatibility with language accepted expressions).\n4. Language specification may omit some details (so also test with golang compiler).\n\n# Requirements for expression:\n1. expression itself and all of subexpression must return exactly one value,\n2. see documentation Bugs section for other requirements/restrictions.\n\n# What does supported:\n\n1. types (by passing predefined/custom types and by defining unnamed types in expression itself),\n2. named arguments (regular variables, typed \u0026 untyped constants, untyped boolean variable),\n3. \"package.SomeThing\" notation,\n4. evaluate expression as if it is evaluates in specified package (even write access to private fields),\n5. evaluate expression like Go evaluates it (following most of specification rules),\n6. position of error in source on evaluation.\n\n# Examples:\nSimple:\n```\nsrc:=\"int8(1*(1+2))\"\nexpr,err:=ParseString(src,\"\")\nif err!=nil{\n\treturn err\n}\nr,err:=expr.EvalToInterface(nil)\nif err!=nil{\n\treturn err\n}\nfmt.Printf(\"%v %T\", r, r)\t// \"3 int8\"\n```\n\nComplicated:\n```\ntype exampleString string\n\nfunc (s exampleString) String() exampleString { return \"!\" + s + \"!\" }\n\ntype exampleStruct struct {\n\tA, B int\n}\n\nfunc (s exampleStruct) Sum() int { return s.A + s.B }\n\nfunc main(){\n\tc := make(chan int64, 10)\n\tc \u003c- 2\n\n\tsrc := `exampleString(fmt.Sprint(interface{}(math.MaxInt64/exampleStruct(struct{ A, B int }{3, 5}).Sum()+int(\u003c-(\u003c-chan int64)(c))-cap(make([]string, 1, 100))))).String().String() + \".\"`\n\n\texpr, err := ParseString(src, \"\")\n\tif err != nil {\n\t\treturn\n\t}\n\ta := Args{\n\t\t\"exampleString\": MakeTypeInterface(exampleString(\"\")),\n\t\t\"fmt.Sprint\":    MakeDataRegularInterface(fmt.Sprint),\n\t\t\"math.MaxInt64\": MakeDataUntypedConst(constanth.MakeUint(math.MaxInt64)),\n\t\t\"exampleStruct\": MakeTypeInterface(exampleStruct{}),\n\t\t\"c\":             MakeDataRegularInterface(c),\n\t}\n\tr, err := expr.EvalToInterface(a)\n\tif err != nil {\n\t\treturn\n\t}\n\tif r != testR {\n\t\treturn\n\t}\n\tfmt.Printf(\"%v %T\\n\", r, r)\t// \"!!1152921504606846877!!. exampleString\"\n\treturn\n}\n```\n\nWith error:\n```\nsrc := `exampleString(fmt.Sprint(interface{}(math.MaxInt64/exampleStruct(struct{ A, B int }{3, 5}).Sum()+int(\u003c-(\u003c-chan int64)(c))-cap(make([]string, 1, 100))))).String().String() + \".\"`\nexpr, err := ParseString(src, \"\")\nif err != nil {\n\tt.Error(err)\n}\na := Args{\n\t\"exampleString\": MakeTypeInterface(exampleString(\"\")),\n\t\"fmt.Sprint\":    MakeDataRegularInterface(fmt.Sprint),\n\t\"math.MaxInt64\": MakeDataUntypedConst(constanth.MakeUint(math.MaxInt64)),\n\t\"exampleStruct\": MakeTypeInterface(exampleStruct{}),\n\t// Remove \"c\" from passed arguments:\n\t// \"c\":             MakeDataRegularInterface(c),\n}\n_, err = expr.EvalToInterface(a)\nfmt.Println(err)\t// \"expression:1:119: undefined: c\"\n```\n\n# Bugs\nPlease report bug if you found it.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapaxa-go%2Feval","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapaxa-go%2Feval","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapaxa-go%2Feval/lists"}