From 2e4944712d9d049bf534f94e6d91fe25c8e1b8df Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Sat, 8 Apr 2017 09:35:56 +0300 Subject: [PATCH] Document Script.Run. Fixes #536 --- script.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/script.go b/script.go index e569af7..133117b 100644 --- a/script.go +++ b/script.go @@ -47,6 +47,8 @@ func (s *Script) EvalSha(c scripter, keys []string, args ...interface{}) *Cmd { return c.EvalSha(s.hash, keys, args...) } +// Run optimistically uses EVALSHA to run the script. If script does not exist +// it is retried using EVAL. func (s *Script) Run(c scripter, keys []string, args ...interface{}) *Cmd { r := s.EvalSha(c, keys, args...) if err := r.Err(); err != nil && strings.HasPrefix(err.Error(), "NOSCRIPT ") {