{"action":"created","comment":{"url":"https://api.github.com/repos/Knetic/govaluate/pulls/comments/68808979","id":68808979,"diff_hunk":"@@ -66,13 +70,13 @@ func NewEvaluableExpression(expression string) (*EvaluableExpression, error) {\n \te.g., if the expression is \"1 + 1\", Evaluate will return 2.0.\n \te.g., if the expression is \"foo + 1\" and parameters contains \"foo\" = 2, Evaluate will return 3.0\n */\n-func (this EvaluableExpression) Evaluate(parameters map[string]interface{}) (interface{}, error) {\n+func (this EvaluableExpression) Eval(parameters Parameters) (interface{}, error) {\n \n \tvar stream *tokenStream\n-\tvar cleanedParameters map[string]interface{}\n+\tvar cleanedParameters Parameters\n \tvar err error\n \n-\tcleanedParameters, err = sanitizeParamters(parameters)\n+\tcleanedParameters = &SanitizedParameters{parameters}","path":"EvaluableExpression.go","position":41,"original_position":41,"commit_id":"8b670a0b41a0647f917e8ff9838ab204fb516964","original_commit_id":"8b670a0b41a0647f917e8ff9838ab204fb516964","user":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"body":"Instead of sanitizing parameters up-front, we just wrap the supplied parameters with SanitizedParameters that does the validation at parameter access time.","created_at":"2016-06-28T17:58:40Z","updated_at":"2016-06-28T17:58:40Z","html_url":"https://github.com/Knetic/govaluate/pull/14#discussion_r68808979","pull_request_url":"https://api.github.com/repos/Knetic/govaluate/pulls/14","_links":{"self":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/comments/68808979"},"html":{"href":"https://github.com/Knetic/govaluate/pull/14#discussion_r68808979"},"pull_request":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/14"}}},"pull_request":{"url":"https://api.github.com/repos/Knetic/govaluate/pulls/14","id":75521945,"html_url":"https://github.com/Knetic/govaluate/pull/14","diff_url":"https://github.com/Knetic/govaluate/pull/14.diff","patch_url":"https://github.com/Knetic/govaluate/pull/14.patch","issue_url":"https://api.github.com/repos/Knetic/govaluate/issues/14","number":14,"state":"open","locked":false,"title":"Made parameters an interface","user":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"body":"@Knetic Thanks for govaluate, I've found it to be very useful.  One problem I had is that specifying parameters as a `map[string]interface{}` is a little inconvenient because I have them in a different data structure.  I can convert by copying them, but that gets expensive for what I'm doing.\r\n\r\nThis PR provides a new `Eval` method that's like the existing `Evaluate` except that it takes a new interface `Parameters`.  This allows me to pass in a different data structure that just provides a `Get` method.","created_at":"2016-06-28T17:57:42Z","updated_at":"2016-06-28T17:58:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed696080c66e76a6e2da127b20b8bbe7a282428b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Knetic/govaluate/pulls/14/commits","review_comments_url":"https://api.github.com/repos/Knetic/govaluate/pulls/14/comments","review_comment_url":"https://api.github.com/repos/Knetic/govaluate/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Knetic/govaluate/issues/14/comments","statuses_url":"https://api.github.com/repos/Knetic/govaluate/statuses/8b670a0b41a0647f917e8ff9838ab204fb516964","head":{"label":"oxtoacart:master","ref":"master","sha":"8b670a0b41a0647f917e8ff9838ab204fb516964","user":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"repo":{"id":62133672,"name":"govaluate","full_name":"oxtoacart/govaluate","owner":{"login":"oxtoacart","id":5000654,"avatar_url":"https://avatars.githubusercontent.com/u/5000654?v=3","gravatar_id":"","url":"https://api.github.com/users/oxtoacart","html_url":"https://github.com/oxtoacart","followers_url":"https://api.github.com/users/oxtoacart/followers","following_url":"https://api.github.com/users/oxtoacart/following{/other_user}","gists_url":"https://api.github.com/users/oxtoacart/gists{/gist_id}","starred_url":"https://api.github.com/users/oxtoacart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oxtoacart/subscriptions","organizations_url":"https://api.github.com/users/oxtoacart/orgs","repos_url":"https://api.github.com/users/oxtoacart/repos","events_url":"https://api.github.com/users/oxtoacart/events{/privacy}","received_events_url":"https://api.github.com/users/oxtoacart/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/oxtoacart/govaluate","description":"Arbitrary expression evaluation for golang","fork":true,"url":"https://api.github.com/repos/oxtoacart/govaluate","forks_url":"https://api.github.com/repos/oxtoacart/govaluate/forks","keys_url":"https://api.github.com/repos/oxtoacart/govaluate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/oxtoacart/govaluate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/oxtoacart/govaluate/teams","hooks_url":"https://api.github.com/repos/oxtoacart/govaluate/hooks","issue_events_url":"https://api.github.com/repos/oxtoacart/govaluate/issues/events{/number}","events_url":"https://api.github.com/repos/oxtoacart/govaluate/events","assignees_url":"https://api.github.com/repos/oxtoacart/govaluate/assignees{/user}","branches_url":"https://api.github.com/repos/oxtoacart/govaluate/branches{/branch}","tags_url":"https://api.github.com/repos/oxtoacart/govaluate/tags","blobs_url":"https://api.github.com/repos/oxtoacart/govaluate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/oxtoacart/govaluate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/oxtoacart/govaluate/git/refs{/sha}","trees_url":"https://api.github.com/repos/oxtoacart/govaluate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/oxtoacart/govaluate/statuses/{sha}","languages_url":"https://api.github.com/repos/oxtoacart/govaluate/languages","stargazers_url":"https://api.github.com/repos/oxtoacart/govaluate/stargazers","contributors_url":"https://api.github.com/repos/oxtoacart/govaluate/contributors","subscribers_url":"https://api.github.com/repos/oxtoacart/govaluate/subscribers","subscription_url":"https://api.github.com/repos/oxtoacart/govaluate/subscription","commits_url":"https://api.github.com/repos/oxtoacart/govaluate/commits{/sha}","git_commits_url":"https://api.github.com/repos/oxtoacart/govaluate/git/commits{/sha}","comments_url":"https://api.github.com/repos/oxtoacart/govaluate/comments{/number}","issue_comment_url":"https://api.github.com/repos/oxtoacart/govaluate/issues/comments{/number}","contents_url":"https://api.github.com/repos/oxtoacart/govaluate/contents/{+path}","compare_url":"https://api.github.com/repos/oxtoacart/govaluate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/oxtoacart/govaluate/merges","archive_url":"https://api.github.com/repos/oxtoacart/govaluate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/oxtoacart/govaluate/downloads","issues_url":"https://api.github.com/repos/oxtoacart/govaluate/issues{/number}","pulls_url":"https://api.github.com/repos/oxtoacart/govaluate/pulls{/number}","milestones_url":"https://api.github.com/repos/oxtoacart/govaluate/milestones{/number}","notifications_url":"https://api.github.com/repos/oxtoacart/govaluate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/oxtoacart/govaluate/labels{/name}","releases_url":"https://api.github.com/repos/oxtoacart/govaluate/releases{/id}","deployments_url":"https://api.github.com/repos/oxtoacart/govaluate/deployments","created_at":"2016-06-28T10:54:28Z","updated_at":"2016-06-28T10:54:29Z","pushed_at":"2016-06-28T11:09:49Z","git_url":"git://github.com/oxtoacart/govaluate.git","ssh_url":"git@github.com:oxtoacart/govaluate.git","clone_url":"https://github.com/oxtoacart/govaluate.git","svn_url":"https://github.com/oxtoacart/govaluate","homepage":"","size":100,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"Knetic:master","ref":"master","sha":"63c7fee765ffe58e3c4693fd159702bb4c38d92d","user":{"login":"Knetic","id":5728164,"avatar_url":"https://avatars.githubusercontent.com/u/5728164?v=3","gravatar_id":"","url":"https://api.github.com/users/Knetic","html_url":"https://github.com/Knetic","followers_url":"https://api.github.com/users/Knetic/followers","following_url":"https://api.github.com/users/Knetic/following{/other_user}","gists_url":"https://api.github.com/users/Knetic/gists{/gist_id}","starred_url":"https://api.github.com/users/Knetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Knetic/subscriptions","organizations_url":"https://api.github.com/users/Knetic/orgs","repos_url":"https://api.github.com/users/Knetic/repos","events_url":"https://api.github.com/users/Knetic/events{/privacy}","received_events_url":"https://api.github.com/users/Knetic/received_events","type":"User","site_admin":false},"repo":{"id":28224380,"name":"govaluate","full_name":"Knetic/govaluate","owner":{"login":"Knetic","id":5728164,"avatar_url":"https://avatars.githubusercontent.com/u/5728164?v=3","gravatar_id":"","url":"https://api.github.com/users/Knetic","html_url":"https://github.com/Knetic","followers_url":"https://api.github.com/users/Knetic/followers","following_url":"https://api.github.com/users/Knetic/following{/other_user}","gists_url":"https://api.github.com/users/Knetic/gists{/gist_id}","starred_url":"https://api.github.com/users/Knetic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Knetic/subscriptions","organizations_url":"https://api.github.com/users/Knetic/orgs","repos_url":"https://api.github.com/users/Knetic/repos","events_url":"https://api.github.com/users/Knetic/events{/privacy}","received_events_url":"https://api.github.com/users/Knetic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Knetic/govaluate","description":"Arbitrary expression evaluation for golang","fork":false,"url":"https://api.github.com/repos/Knetic/govaluate","forks_url":"https://api.github.com/repos/Knetic/govaluate/forks","keys_url":"https://api.github.com/repos/Knetic/govaluate/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Knetic/govaluate/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Knetic/govaluate/teams","hooks_url":"https://api.github.com/repos/Knetic/govaluate/hooks","issue_events_url":"https://api.github.com/repos/Knetic/govaluate/issues/events{/number}","events_url":"https://api.github.com/repos/Knetic/govaluate/events","assignees_url":"https://api.github.com/repos/Knetic/govaluate/assignees{/user}","branches_url":"https://api.github.com/repos/Knetic/govaluate/branches{/branch}","tags_url":"https://api.github.com/repos/Knetic/govaluate/tags","blobs_url":"https://api.github.com/repos/Knetic/govaluate/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Knetic/govaluate/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Knetic/govaluate/git/refs{/sha}","trees_url":"https://api.github.com/repos/Knetic/govaluate/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Knetic/govaluate/statuses/{sha}","languages_url":"https://api.github.com/repos/Knetic/govaluate/languages","stargazers_url":"https://api.github.com/repos/Knetic/govaluate/stargazers","contributors_url":"https://api.github.com/repos/Knetic/govaluate/contributors","subscribers_url":"https://api.github.com/repos/Knetic/govaluate/subscribers","subscription_url":"https://api.github.com/repos/Knetic/govaluate/subscription","commits_url":"https://api.github.com/repos/Knetic/govaluate/commits{/sha}","git_commits_url":"https://api.github.com/repos/Knetic/govaluate/git/commits{/sha}","comments_url":"https://api.github.com/repos/Knetic/govaluate/comments{/number}","issue_comment_url":"https://api.github.com/repos/Knetic/govaluate/issues/comments{/number}","contents_url":"https://api.github.com/repos/Knetic/govaluate/contents/{+path}","compare_url":"https://api.github.com/repos/Knetic/govaluate/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Knetic/govaluate/merges","archive_url":"https://api.github.com/repos/Knetic/govaluate/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Knetic/govaluate/downloads","issues_url":"https://api.github.com/repos/Knetic/govaluate/issues{/number}","pulls_url":"https://api.github.com/repos/Knetic/govaluate/pulls{/number}","milestones_url":"https://api.github.com/repos/Knetic/govaluate/milestones{/number}","notifications_url":"https://api.github.com/repos/Knetic/govaluate/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Knetic/govaluate/labels{/name}","releases_url":"https://api.github.com/repos/Knetic/govaluate/releases{/id}","deployments_url":"https://api.github.com/repos/Knetic/govaluate/deployments","created_at":"2014-12-19T10:06:30Z","updated_at":"2016-06-27T09:25:26Z","pushed_at":"2016-06-28T17:57:42Z","git_url":"git://github.com/Knetic/govaluate.git","ssh_url":"git@github.com:Knetic/govaluate.git","clone_url":"https://github.com/Knetic/govaluate.git","svn_url":"https://github.com/Knetic/govaluate","homepage":"","size":101,"stargazers_count":18,"watchers_count":18,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":2,"forks":6,"open_issues":2,"watchers":18,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/14"},"html":{"href":"https://github.com/Knetic/govaluate/pull/14"},"issue":{"href":"https://api.github.com/repos/Knetic/govaluate/issues/14"},"comments":{"href":"https://api.github.com/repos/Knetic/govaluate/issues/14/comments"},"review_comments":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/14/comments"},"review_comment":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Knetic/govaluate/pulls/14/commits"},"statuses":{"href":"https://api.github.com/repos/Knetic/govaluate/statuses/8b670a0b41a0647f917e8ff9838ab204fb516964"}}}}
{"actor":{"display_login":"oxtoacart"}}