text:
cmd/govim: "no object for ident" error when doing multiple renames

What version of Vim/Gvim are you using?
Vim/Gvim version
$ vim --version
VIM - Vi IMproved 8.1 (2018 May 18, compiled Aug  8 2019 17:15:45)
Included patches: 1-1830
Compiled by caleb@caleb-desktop
Huge version with GTK2 GUI.  Features included (+) or not (-):
+acl               -farsi             -mouse_sysmouse    -tag_any_white
+arabic            +file_in_path      +mouse_urxvt       -tcl
+autocmd           +find_in_path      +mouse_xterm       +termguicolors
+autochdir         +float             +multi_byte        +terminal
-autoservername    +folding           +multi_lang        +terminfo
+balloon_eval      -footer            -mzscheme          +termresponse
+balloon_eval_term +fork()            +netbeans_intg     +textobjects
+browse            +gettext           +num64             +textprop
++builtin_terms    -hangul_input      +packages          +timers
+byte_offset       +iconv             +path_extra        +title
+channel           +insert_expand     +perl              +toolbar
+cindent           +job               +persistent_undo   +user_commands
+clientserver      +jumplist          +postscript        +vartabs
+clipboard         +keymap            +printer           +vertsplit
+cmdline_compl     +lambda            +profile           +virtualedit
+cmdline_hist      +langmap           -python            +visual
+cmdline_info      +libcall           -python3           +visualextra
+comments          +linebreak         +quickfix          +viminfo
+conceal           +lispindent        +reltime           +vreplace
+cryptv            +listcmds          +rightleft         +wildignore
+cscope            +localmap          +ruby              +wildmenu
+cursorbind        -lua               +scrollbind        +windows
+cursorshape       +menu              +signs             +writebackup
+dialog_con_gui    +mksession         +smartindent       +X11
+diff              +modify_fname      -sound             -xfontset
+digraphs          +mouse             +spell             +xim
+dnd               +mouseshape        +startuptime       +xpm
-ebcdic            +mouse_dec         +statusline        +xsmp_interact
+emacs_tags        +mouse_gpm         -sun_workshop      +xterm_clipboard
+eval              -mouse_jsbterm     +syntax            -xterm_save
+ex_extra          +mouse_netterm     +tag_binary
+extra_search      +mouse_sgr         -tag_old_static
   system vimrc file: "$VIM/vimrc"
     user vimrc file: "$HOME/.vimrc"
 2nd user vimrc file: "~/.vim/vimrc"
      user exrc file: "$HOME/.exrc"
  system gvimrc file: "$VIM/gvimrc"
    user gvimrc file: "$HOME/.gvimrc"
2nd user gvimrc file: "~/.vim/gvimrc"
       defaults file: "$VIMRUNTIME/defaults.vim"
    system menu file: "$VIMRUNTIME/menu.vim"
  fall-back for $VIM: "/home/caleb/share/vim"
Compilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1
Linking: gcc   -L. -L/home/caleb/.rbenv/versions/2.3.1/lib  -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm -ldl   -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt    -Wl,-R/home/caleb/.rbenv/versions/2.3.1/lib -L/home/caleb/.rbenv/versions/2.3.1/lib -lruby-static -lpthread -ldl -lcrypt -lm  -L/home/caleb/.rbenv/versions/2.3.1/lib

What version of Go are you using (go version)?

$ go version
go version go1.12.5 linux/amd64

What operating system and processor architecture are you using (go env)?
go env Output
$ go env
GOARCH="amd64"
GOBIN="/home/caleb/bin"
GOCACHE="/home/caleb/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/caleb/p/go:/home/caleb"
GOPROXY=""
GORACE=""
GOROOT="/home/caleb/apps/go"
GOTMPDIR=""
GOTOOLDIR="/home/caleb/apps/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/caleb/.vim/pack/plugins/start/govim/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build138475155=/tmp/go-build -gno-record-gcc-switches"

What version/commit of govim are you using?
b6bbbaec1c8457db55c5f7e26d3030fe5c118d13
What is the output of :messages in Vim?
Messages maintainer: Bram Moolenaar <Bram@vim.org>
"xxhash.go" 236L, 5431C
"~/p/xxhash/xxhash_test.go" 313L, 7485C
"~/p/xxhash/xxhash_unsafe_test.go" 24L, 402C
"xxhash.go" 236L, 5437C written
"~/p/xxhash/xxhash_test.go" 313L, 7515C written
"~/p/xxhash/xxhash_unsafe_test.go" 24L, 405C written
Error detected while processing function <SNR>10_callbackCommand:
line    5:
E605: Exception not caught: got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC

Do the Vim channel, govim or gopls log files show anything interesting?
channel log
==== start log session ====
==== start log session ====
  0.007016 : Starting job: /home/caleb/.vim/pack/plugins/start/govim/cmd/govim/.bin/b6bbbaec1c8457db55c5f7e26d3030fe5c118d13/govim  /home/caleb/.vim/pack/plugins/start/govim/cmd/govim/.bin/b6bbbaec1c8457db55c5f7e26d3030fe5c118d13/gopls
  0.007044 on 0: Created channel
  0.039913 RECV on 0(out): '[0,[1,"loaded"]]
'
  0.094432 : Starting job: sh  -c  git status --porcelain -- '/home/caleb/p/xxhash/xxhash.go'
  0.094452 on 1: Created channel
  0.097273 : looking for messages on channels
  0.097302 on 0: Getting JSON message 0
  0.097306 on 0: Invoking channel callback 10_define
  0.097393 SEND on 0(in): '[1,["callback",1,[""]]]
'
  0.097721 RECV on 0(out): '[0,[2,"ex","let s:govim_logfile=\"/tmp/govim_log_20190819_1513_29_196275829\""]]
'
  0.097725 : looking for messages on channels
  0.097740 on 0: Getting JSON message 0
  0.097745 on 0: Invoking channel callback 10_define
  0.097864 SEND on 0(in): '[2,["callback",2,[""]]]
'
  0.097880 on 1: Job ended
  0.097888 : looking for messages on channels
  0.097913 on 1: channel_select_check(): Read EOF from ch_part[1], closing
  0.097919 : looking for messages on channels
  0.097922 on 1: Closing channel because all readable fds are closed
  0.097924 on 1: Closing channel
  0.097927 on 1: Invoking callbacks and flushing buffers before closing
  0.097930 on 1: Invoking close callback 99_on_exit_untracked
  0.098535 RECV on 0(out): '[0,[3,"expr","{\"Version\": execute(\"version\"), \"VersionLong\": exists(\"v:versionlong\")?v:versionlong:-1, \"GuiRunning\": has(\"gui_running\")}"]]
'
  0.098538 : looking for messages on channels
  0.098552 on 0: Getting JSON message 0
  0.098557 on 0: Invoking channel callback 10_define
  0.098839 SEND on 0(in): '[3,["callback",3,["",{"Version":"\n\nVIM - Vi IMproved 8.1 (2018 May 18, compiled Aug  8 2019 17:15:45)\nIncluded patches: 1-1830\nCompiled by caleb@caleb-desktop\nHuge version with GTK2 GUI.  Features included (+) or not (-):\n+acl               +clipboard         +dnd               +gettext           +localmap          +mouse_urxvt       +profile           +statusline        +timers            +windows\n+arabic            +cmdline_compl     -ebcdic            -hangul_input      -lua               +mouse_xterm       -python            -sun_workshop      +title             +writebackup\n+autocmd           +cmdline_hist      +emacs_tags        +iconv             +menu              +multi_byte        -python3           +syntax            +toolbar           +X11\n+autochdir         +cmdline_info      +eval              +insert_expand     +mksession         +multi_lang        +quickfix          +tag_binary        +user_commands     -xfontset\n-autoservername    +comments          +ex_extra          +job               +modify_fname      -mzscheme          +reltime           -tag_old_static    +vartabs           +xim\n+balloon_eval      +conceal           +extra_search      +jumplist          +mouse             +netbeans_intg     +rightleft         -tag_any_white     +vertsplit         +xpm\n+balloon_eval_term +cryptv            -farsi             +keymap            +mouseshape        +num64             +ruby              -tcl               +virtualedit       +xsmp_interact\n+browse            +cscope            +file_in_path      +lambda            +mouse_dec         +packages          +scrollbind        +termguicolors     +visual            +xterm_clipboard\n++builtin_terms    +cursorbind        +find_in_path      +langmap           +mouse_gpm         +path_extra        +signs             +terminal          +visualextra       -xterm_save\n+byte_offset       +cursorshape       +float             +libcall           -mouse_jsbterm     +perl              +smartindent       +terminfo          +viminfo           \n+channel           +dialog_con_gui    +folding           +linebreak         +mouse_netterm     +persistent_undo   -sound             +termresponse      +vreplace          \n+cindent           +diff              -footer            +lispindent        +mouse_sgr         +postscript        +spell             +textobjects       +wildignore        \n+clientserver      +digraphs          +fork()            +listcmds          -mouse_sysmouse    +printer           +startuptime       +textprop          +wildmenu          \n   system vimrc file: \"$VIM/vimrc\"\n     user vimrc file: \"$HOME/.vimrc\"\n 2nd user vimrc file: \"~/.vim/vimrc\"\n      user exrc file: \"$HOME/.exrc\"\n  system gvimrc file: \"$VIM/gvimrc\"\n    user gvimrc file: \"$HOME/.gvimrc\"\n2nd user gvimrc file: \"~/.vim/gvimrc\"\n       defaults file: \"$VIMRUNTIME/defaults.vim\"\n    system menu file: \"$VIMRUNTIME/menu.vim\"\n  fall-back for $VIM: \"/home/caleb/share/vim\"\nCompilation: gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_GTK  -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/gio-unix-2.0/ -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pixman-1 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/libpng16 -I/usr/include/pango-1.0 -I/usr/include/harfbuzz -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16   -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1       \nLinking: gcc   -L. -L/home/caleb/.rbenv/versions/2.3.1/lib  -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-E   -L/usr/local/lib -Wl,--as-needed -o vim   -lgtk-x11-2.0 -lgdk-x11-2.0 -lpangocairo-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lfontconfig -lfreetype -lSM -lICE -lXpm -lXt -lX11 -lXdmcp -lSM -lICE  -lm -ltinfo -lnsl  -lselinux -lacl -lattr -lgpm -ldl   -Wl,-E  -fstack-protector-strong -L/usr/local/lib  -L/usr/lib/x86_64-linux-gnu/perl/5.26/CORE -lperl -ldl -lm -lpthread -lcrypt    -Wl,-R/home/caleb/.rbenv/versions/2.3.1/lib -L/home/caleb/.rbenv/versions/2.3.1/lib -lruby-static -lpthread -ldl -lcrypt -lm  -L/home/caleb/.rbenv/versions/2.3.1/lib    ","GuiRunning":0,"VersionLong":8011830}]]]
'
  0.099248 RECV on 0(out): '[0,[4,"ex","augroup govim"]]
'
  0.099252 : looking for messages on channels
  0.099265 on 0: Getting JSON message 0
  0.099270 on 0: Invoking channel callback 10_define
  0.099383 SEND on 0(in): '[4,["callback",4,[""]]]
'
  0.099521 RECV on 0(out): '[0,[5,"ex","augroup END"]]
'
  0.099525 : looking for messages on channels
  0.099534 on 0: Getting JSON message 0
  0.099537 on 0: Invoking channel callback 10_define
  0.099631 SEND on 0(in): '[5,["callback",5,[""]]]
'
  0.099788 RECV on 0(out): '[0,[6,"function","GOVIM_internal_BalloonExpr",[]]]
'
  0.099792 : looking for messages on channels
  0.099805 on 0: Getting JSON message 0
  0.099811 on 0: Invoking channel callback 10_define
  0.099956 SEND on 0(in): '[6,["callback",6,[""]]]
'
  0.100052 RECV on 0(out): '[0,[7,"autocmd","autocommand:0"," govim BufNewFile,BufRead *.go",["{\"Num\": eval(expand('\u003cabuf\u003e')), \"Name\": fnamemodify(bufname(eval(expand('\u003cabuf\u003e'))),':p'), \"Contents\": join(getbufline(eval(expand('\u003cabuf\u003e')), 0, \"$\"), \"\\n\").\"\\n\"}"]]]
'
  0.100056 : looking for messages on channels
  0.100069 on 0: Getting JSON message 0
  0.100073 on 0: Invoking channel callback 10_define
  0.100259 SEND on 0(in): '[7,["callback",7,[""]]]
'
  0.100485 RECV on 0(out): '[0,[8,"autocmd","autocommand:1"," govim BufWritePre *.go",["eval(expand('\u003cabuf\u003e'))"]]]
'
  0.100490 : looking for messages on channels
  0.100509 on 0: Getting JSON message 0
  0.100515 on 0: Invoking channel callback 10_define
  0.100694 SEND on 0(in): '[8,["callback",8,[""]]]
'
  0.100875 RECV on 0(out): '[0,[9,"function","GOVIM_internal_Complete",["findarg","base"]]]
'
  0.100877 : looking for messages on channels
  0.100885 on 0: Getting JSON message 0
  0.100889 on 0: Invoking channel callback 10_define
  0.101077 SEND on 0(in): '[9,["callback",9,[""]]]
'
  0.101311 RECV on 0(out): '[0,[10,"command","GOVIMGoToDef",{"nargs":"-nargs=?"}]]
'
  0.101314 : looking for messages on channels
  0.101338 on 0: Getting JSON message 0
  0.101343 on 0: Invoking channel callback 10_define
  0.101564 SEND on 0(in): '[10,["callback",10,[""]]]
'
  0.101737 RECV on 0(out): '[0,[11,"command","GOVIMGoToPrevDef",{"count":"-count=1","nargs":"-nargs=?"}]]
'
  0.101740 : looking for messages on channels
  0.101752 on 0: Getting JSON message 0
  0.101756 on 0: Invoking channel callback 10_define
  0.101970 SEND on 0(in): '[11,["callback",11,[""]]]
'
  0.102163 RECV on 0(out): '[0,[12,"function","GOVIMHover",[]]]
'
  0.102166 : looking for messages on channels
  0.102177 on 0: Getting JSON message 0
  0.102183 on 0: Invoking channel callback 10_define
  0.102359 SEND on 0(in): '[12,["callback",12,[""]]]
'
  0.102496 RECV on 0(out): '[0,[13,"autocmd","autocommand:2"," govim BufDelete *.go",["eval(expand('\u003cabuf\u003e'))"]]]
'
  0.102499 : looking for messages on channels
  0.102509 on 0: Getting JSON message 0
  0.102513 on 0: Invoking channel callback 10_define
  0.102667 SEND on 0(in): '[13,["callback",13,[""]]]
'
  0.102829 RECV on 0(out): '[0,[14,"command","GOVIMGoFmt",{}]]
'
  0.102832 : looking for messages on channels
  0.102843 on 0: Getting JSON message 0
  0.102849 on 0: Invoking channel callback 10_define
  0.103050 SEND on 0(in): '[14,["callback",14,[""]]]
'
  0.103200 RECV on 0(out): '[0,[15,"command","GOVIMGoImports",{}]]
'
  0.103202 : looking for messages on channels
  0.103212 on 0: Getting JSON message 0
  0.103216 on 0: Invoking channel callback 10_define
  0.103408 SEND on 0(in): '[15,["callback",15,[""]]]
'
  0.103512 RECV on 0(out): '[0,[16,"command","GOVIMQuickfixDiagnostics",{}]]
'
  0.103515 : looking for messages on channels
  0.103523 on 0: Getting JSON message 0
  0.103527 on 0: Invoking channel callback 10_define
  0.103725 SEND on 0(in): '[16,["callback",16,[""]]]
'
  0.103867 RECV on 0(out): '[0,[17,"function","GOVIM_internal_BufChanged",["bufnr","start","end","added","changes"]]]
'
  0.103869 : looking for messages on channels
  0.103880 on 0: Getting JSON message 0
  0.103884 on 0: Invoking channel callback 10_define
  0.104096 SEND on 0(in): '[17,["callback",17,[""]]]
'
  0.104266 RECV on 0(out): '[0,[18,"function","GOVIM_internal_SetConfig",["config"]]]
'
  0.104269 : looking for messages on channels
  0.104280 on 0: Getting JSON message 0
  0.104286 on 0: Invoking channel callback 10_define
  0.104472 SEND on 0(in): '[18,["callback",18,[""]]]
'
  0.104634 RECV on 0(out): '[0,[19,"ex","call govim#config#Set(\"_internal_Func\", function(\"GOVIM_internal_SetConfig\"))"]]
'
  0.104637 : looking for messages on channels
  0.104648 on 0: Getting JSON message 0
  0.104655 on 0: Invoking channel callback 10_define
  0.104816 SEND on 0(in): '[19,["function","function:GOVIM_internal_SetConfig",[{"QuickfixSignsDisable":1,"FormatOnSave":"goimports","QuickfixAutoDiagnosticsDisable":1}]]]
'
  0.104827 on 0: Blocking read JSON for id 19
  0.104831 : looking for messages on channels
  0.104835 on 0: Waiting for up to 30000 msec
  0.105119 RECV on 0(out): '[19,["",null]]
'
  0.105123 on 0: Getting JSON message 19
  0.105128 on 0: Received JSON for id 19
  0.105188 SEND on 0(in): '[20,["callback",19,[""]]]
'
  0.105343 RECV on 0(out): '[0,[20,"function","GOVIM_internal_SetUserBusy",["isBusy"]]]
'
  0.105346 : looking for messages on channels
  0.105356 on 0: Getting JSON message 0
  0.105367 on 0: Invoking channel callback 10_define
  0.105542 SEND on 0(in): '[21,["callback",20,[""]]]
'
  0.105692 RECV on 0(out): '[0,[21,"command","GOVIMReferences",{}]]
'
  0.105695 : looking for messages on channels
  0.105704 on 0: Getting JSON message 0
  0.105708 on 0: Invoking channel callback 10_define
  0.105906 SEND on 0(in): '[22,["callback",21,[""]]]
'
  0.106040 RECV on 0(out): '[0,[22,"command","GOVIMRename",{"nargs":"-nargs=?"}]]
'
  0.106044 : looking for messages on channels
  0.106056 on 0: Getting JSON message 0
  0.106063 on 0: Invoking channel callback 10_define
  0.106266 SEND on 0(in): '[23,["callback",22,[""]]]
'
  0.106400 RECV on 0(out): '[0,[23,"command","GOVIMStringFn",{"complete":"-complete=customlist,GOVIM_internal_StringFnComplete","nargs":"-nargs=+","range":"-range"}]]
'
  0.106405 : looking for messages on channels
  0.106420 on 0: Getting JSON message 0
  0.106433 on 0: Invoking channel callback 10_define
  0.106642 SEND on 0(in): '[24,["callback",23,[""]]]
'
  0.106834 RECV on 0(out): '[0,[24,"function","GOVIM_internal_StringFnComplete",["ArgLead","CmdLine","CursorPos"]]]
'
  0.106838 : looking for messages on channels
  0.106850 on 0: Getting JSON message 0
  0.106854 on 0: Invoking channel callback 10_define
  0.107036 SEND on 0(in): '[25,["callback",24,[""]]]
'
  0.107255 RECV on 0(out): '[0,[25,"call","sign_define","govimerr",{"text":"\u003e\u003e","texthl":"Error"}]]
'
  0.107258 : looking for messages on channels
  0.107270 on 0: Getting JSON message 0
  0.107275 on 0: Invoking channel callback 10_define
  0.107401 SEND on 0(in): '[26,["callback",25,["",0]]]
'
  0.107597 RECV on 0(out): '[0,[26,"function","GOVIMMotion",["direction","target"]]]
'
  0.107600 : looking for messages on channels
  0.107611 on 0: Getting JSON message 0
  0.107615 on 0: Invoking channel callback 10_define
  0.107853 SEND on 0(in): '[27,["callback",26,[""]]]
'
  0.107976 RECV on 0(out): '[0,[27,"expr","has(\"gui_running\")"]]
'
  0.107980 : looking for messages on channels
  0.107991 on 0: Getting JSON message 0
  0.107995 on 0: Invoking channel callback 10_define
  0.108114 SEND on 0(in): '[28,["callback",27,["",0]]]
'
  0.108322 RECV on 0(out): '[0,[28,"ex","let s:gopls_logfile=\"/tmp/gopls_log_20190819_1513_30_969400144\""]]
'
  0.108325 : looking for messages on channels
  0.108334 on 0: Getting JSON message 0
  0.108337 on 0: Invoking channel callback 10_define
  0.108441 SEND on 0(in): '[29,["callback",28,[""]]]
'
  0.109006 RECV on 0(out): '[0,[29,"call","getcwd",-1]]
'
  0.109011 : looking for messages on channels
  0.109024 on 0: Getting JSON message 0
  0.109030 on 0: Invoking channel callback 10_define
  0.109196 SEND on 0(in): '[30,["callback",29,["","/home/caleb/p/xxhash"]]]
'
  0.140872 RECV on 0(out): '[0,[30,"initcomplete"]]
'
  0.140889 : looking for messages on channels
  0.140910 on 0: Getting JSON message 0
  0.140915 on 0: Invoking channel callback 10_define
  0.147398 SEND on 0(in): '[31,["function","autocommand:0",[{"Num":1,"Name":"/home/caleb/p/xxhash/xxhash.go","Contents":"// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described\n// at http://cyan4973.github.io/xxHash/.\npackage xxhash\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"math/bits\"\n)\n\nconst (\n\tprime1 uint64 = 11400714785074694791\n\tprime2 uint64 = 14029467366897019727\n\tprime3 uint64 = 1609587929392839161\n\tprime4 uint64 = 9650029242287828579\n\tprime5 uint64 = 2870177450012600261\n)\n\n// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where\n// possible in the Go code is worth a small (but measurable) performance boost\n// by avoiding some MOVQs. Vars are needed for the asm and also are useful for\n// convenience in the Go code in a few places where we need to intentionally\n// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the\n// result overflows a uint64).\nvar (\n\tprime1v = prime1\n\tprime2v = prime2\n\tprime3v = prime3\n\tprime4v = prime4\n\tprime5v = prime5\n)\n\n// Digest implements hash.Hash64.\ntype Digest struct {\n\tv1    uint64\n\tv2    uint64\n\tv3    uint64\n\tv4    uint64\n\ttotal uint64\n\tmem   [32]byte\n\tn     int // how much of mem is used\n}\n\n// New creates a new Digest that computes the 64-bit xxHash algorithm.\nfunc New() *Digest {\n\tvar d Digest\n\td.Reset()\n\treturn &d\n}\n\n// Reset clears the Digest's state so that it can be reused.\nfunc (d *Digest) Reset() {\n\td.v1 = prime1v + prime2\n\td.v2 = prime2\n\td.v3 = 0\n\td.v4 = -prime1v\n\td.total = 0\n\td.n = 0\n}\n\n// Size always returns 8 bytes.\nfunc (d *Digest) Size() int { return 8 }\n\n// BlockSize always returns 32 bytes.\nfunc (d *Digest) BlockSize() int { return 32 }\n\n// Write adds more data to d. It always returns len(b), nil.\nfunc (d *Digest) Write(b []byte) (n int, err error) {\n\tn = len(b)\n\td.total += uint64(n)\n\n\tif d.n+n < 32 {\n\t\t// This new data doesn't even fill the current block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.n += n\n\t\treturn\n\t}\n\n\tif d.n > 0 {\n\t\t// Finish off the partial block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.v1 = round(d.v1, u64(d.mem[0:8]))\n\t\td.v2 = round(d.v2, u64(d.mem[8:16]))\n\t\td.v3 = round(d.v3, u64(d.mem[16:24]))\n\t\td.v4 = round(d.v4, u64(d.mem[24:32]))\n\t\tb = b[32-d.n:]\n\t\td.n = 0\n\t}\n\n\tif len(b) >= 32 {\n\t\t// One or more full blocks left.\n\t\tnw := writeBlocks(d, b)\n\t\tb = b[nw:]\n\t}\n\n\t// Store any remaining partial block.\n\tcopy(d.mem[:], b)\n\td.n = len(b)\n\n\treturn\n}\n\n// Sum appends the current hash to b and returns the resulting slice.\nfunc (d *Digest) Sum(b []byte) []byte {\n\ts := d.Sum64()\n\treturn append(\n\t\tb,\n\t\tbyte(s>>56),\n\t\tbyte(s>>48),\n\t\tbyte(s>>40),\n\t\tbyte(s>>32),\n\t\tbyte(s>>24),\n\t\tbyte(s>>16),\n\t\tbyte(s>>8),\n\t\tbyte(s),\n\t)\n}\n\n// Sum64 returns the current hash.\nfunc (d *Digest) Sum64() uint64 {\n\tvar h uint64\n\n\tif d.total >= 32 {\n\t\tv1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4\n\t\th = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)\n\t\th = mergeRound(h, v1)\n\t\th = mergeRound(h, v2)\n\t\th = mergeRound(h, v3)\n\t\th = mergeRound(h, v4)\n\t} else {\n\t\th = d.v3 + prime5\n\t}\n\n\th += d.total\n\n\ti, end := 0, d.n\n\tfor ; i+8 <= end; i += 8 {\n\t\tk1 := round(0, u64(d.mem[i:i+8]))\n\t\th ^= k1\n\t\th = rol27(h)*prime1 + prime4\n\t}\n\tif i+4 <= end {\n\t\th ^= uint64(u32(d.mem[i:i+4])) * prime1\n\t\th = rol23(h)*prime2 + prime3\n\t\ti += 4\n\t}\n\tfor i < end {\n\t\th ^= uint64(d.mem[i]) * prime5\n\t\th = rol11(h) * prime1\n\t\ti++\n\t}\n\n\th ^= h >> 33\n\th *= prime2\n\th ^= h >> 29\n\th *= prime3\n\th ^= h >> 32\n\n\treturn h\n}\n\nconst (\n\tmagic         = \"xxh\\x06\"\n\tmarshaledSize = len(magic) + 8*5 + 32\n)\n\n// MarshalBinary implements the encoding.BinaryMarshaler interface.\nfunc (d *Digest) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 0, marshaledSize)\n\tb = append(b, magic...)\n\tb = appendUint64(b, d.v1)\n\tb = appendUint64(b, d.v2)\n\tb = appendUint64(b, d.v3)\n\tb = appendUint64(b, d.v4)\n\tb = appendUint64(b, d.total)\n\tb = append(b, d.mem[:d.n]...)\n\tb = b[:len(b)+len(d.mem)-d.n]\n\treturn b, nil\n}\n\n// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.\nfunc (d *Digest) UnmarshalBinary(b []byte) error {\n\tif len(b) < len(magic) || string(b[:len(magic)]) != magic {\n\t\treturn errors.New(\"xxhash: invalid hash state identifier\")\n\t}\n\tif len(b) != marshaledSize {\n\t\treturn errors.New(\"xxhash: invalid hash state size\")\n\t}\n\tb = b[len(magic):]\n\tb, d.v1 = consumeUint64(b)\n\tb, d.v2 = consumeUint64(b)\n\tb, d.v3 = consumeUint64(b)\n\tb, d.v4 = consumeUint64(b)\n\tb, d.total = consumeUint64(b)\n\tcopy(d.mem[:], b)\n\tb = b[len(d.mem):]\n\td.n = int(d.total % uint64(len(d.mem)))\n\treturn nil\n}\n\nfunc appendUint64(b []byte, x uint64) []byte {\n\tvar a [8]byte\n\tbinary.LittleEndian.PutUint64(a[:], x)\n\treturn append(b, a[:]...)\n}\n\nfunc consumeUint64(b []byte) ([]byte, uint64) {\n\tx := u64(b)\n\treturn b[8:], x\n}\n\nfunc u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }\nfunc u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }\n\nfunc round(acc, input uint64) uint64 {\n\tacc += input * prime2\n\tacc = rol31(acc)\n\tacc *= prime1\n\treturn acc\n}\n\nfunc mergeRound(acc, val uint64) uint64 {\n\tval = round(0, val)\n\tacc ^= val\n\tacc = acc*prime1 + prime4\n\treturn acc\n}\n\nfunc rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }\nfunc rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }\nfunc rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }\nfunc rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }\nfunc rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }\nfunc rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }\nfunc rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }\nfunc rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }\n"}]]]
'
  0.147432 on 0: Blocking read JSON for id 31
  0.147436 : looking for messages on channels
  0.147441 on 0: Waiting for up to 30000 msec
  0.148009 RECV on 0(out): '[0,[31,"call","listener_add","GOVIM_internal_EnrichDelta",1]]
'
  0.148016 : looking for messages on channels
  0.148029 on 0: Getting JSON message 0
  0.148032 on 0: Invoking channel callback 10_define
  0.148143 SEND on 0(in): '[32,["callback",31,["",1]]]
'
  0.148156 : looking for messages on channels
  0.148159 on 0: Waiting for up to 30000 msec
  0.149311 RECV on 0(out): '[31,["",null]]
'
  0.149317 on 0: Getting JSON message 31
  0.149323 on 0: Received JSON for id 31
  0.152992 SEND on 0(in): '[33,["callback",30,[""]]]
'
  0.258396 : looking for messages on channels
  1.101382 on 1: Freeing job
  1.101406 on 1: Closing channel
  1.101413 on 1: Clearing channel
  1.101420 on 1: Freeing channel
  1.101434 : looking for messages on channels
  7.202812 SEND on 0(in): '[34,["function","command:GOVIMRename",{"mods":""}]]
'
  7.202857 on 0: Blocking read JSON for id 34
  7.202866 : looking for messages on channels
  7.202872 on 0: Waiting for up to 30000 msec
  7.203370 RECV on 0(out): '[0,[32,"expr","{\"bufnum\": bufnr(\"\"), \"line\": line(\".\"), \"col\": col(\".\")}"]]
'
  7.203388 : looking for messages on channels
  7.203407 on 0: Getting JSON message 0
  7.203417 on 0: Invoking channel callback 10_define
  7.203657 SEND on 0(in): '[35,["callback",32,["",{"bufnum":1,"col":7,"line":45}]]]
'
  7.203716 : looking for messages on channels
  7.203725 on 0: Waiting for up to 30000 msec
  7.203990 RECV on 0(out): '[0,[33,"expr","expand(\"\u003ccword\u003e\")"]]
'
  7.204002 : looking for messages on channels
  7.204012 on 0: Getting JSON message 0
  7.204018 on 0: Invoking channel callback 10_define
  7.204225 SEND on 0(in): '[36,["callback",33,["","New"]]]
'
  7.204247 : looking for messages on channels
  7.204254 on 0: Waiting for up to 30000 msec
  7.204497 RECV on 0(out): '[0,[34,"expr","input(\"govim: rename 'New' to: \", \"New\")"]]
'
  7.204515 : looking for messages on channels
  7.204536 on 0: Getting JSON message 0
  7.204545 on 0: Invoking channel callback 10_define
  7.204804 : looking for messages on channels
 10.282786 SEND on 0(in): '[37,["callback",34,["","NewABC"]]]
'
 10.282840 : looking for messages on channels
 10.282849 on 0: Waiting for up to 30000 msec
 10.289293 RECV on 0(out): '[0,[35,"expr","s:buildCurrentViewport()"]]
'
 10.289314 : looking for messages on channels
 10.289336 on 0: Getting JSON message 0
 10.289345 on 0: Invoking channel callback 10_define
 10.289709 SEND on 0(in): '[38,["callback",35,["",{"Current":{"winnr":1,"botline":70,"height":50,"bufnr":1,"winbar":0,"width":191,"tabnr":1,"quickfix":0,"topline":21,"loclist":0,"wincol":1,"winrow":1,"winid":1000,"terminal":0},"Windows":[{"winnr":1,"botline":70,"height":50,"bufnr":1,"winbar":0,"width":191,"tabnr":1,"quickfix":0,"topline":21,"loclist":0,"wincol":1,"winrow":1,"winid":1000,"terminal":0}]}]]]
'
 10.289739 : looking for messages on channels
 10.289747 on 0: Waiting for up to 30000 msec
 10.290220 RECV on 0(out): '[0,[36,"call","getbufinfo","/home/caleb/p/xxhash/xxhash.go"]]
'
 10.290238 : looking for messages on channels
 10.290256 on 0: Getting JSON message 0
 10.290265 on 0: Invoking channel callback 10_define
 10.290552 SEND on 0(in): '[39,["callback",36,["",[{"lnum":45,"bufnr":1,"variables":{"buffer_vcs_config":{"git":{"untracked":"","branch":"master"},"mercurial":{"untracked":"","branch":""}},"current_syntax":"go","airline_ws_changedtick":3,"git_dir":"/home/caleb/p/xxhash/.git","endwise_syngroups":".*","endwise_words":"{","did_indent":1,"fugitive_name":"xxhash.go","loaded_lastplace_plugin":1,"endwise_pattern":"{\\s*$","endwise_addition":"}","airline_head":"master","did_ftplugin":1,"undo_ftplugin":"setl fo< com< cms<","changedtick":3},"popups":[],"name":"/home/caleb/p/xxhash/xxhash.go","changed":0,"loaded":1,"windows":[1000],"hidden":0,"listed":1,"changedtick":3}]]]]
'
 10.290592 : looking for messages on channels
 10.290599 on 0: Waiting for up to 30000 msec
 10.291011 RECV on 0(out): '[0,[37,"call","getbufinfo","/home/caleb/p/xxhash/xxhash_test.go"]]
'
 10.291030 : looking for messages on channels
 10.291048 on 0: Getting JSON message 0
 10.291057 on 0: Invoking channel callback 10_define
 10.291400 SEND on 0(in): '[40,["callback",37,["",[]]]]
'
 10.291426 : looking for messages on channels
 10.291434 on 0: Waiting for up to 30000 msec
 10.291707 RECV on 0(out): '[0,[38,"ex"," split /home/caleb/p/xxhash/xxhash_test.go"]]
'
 10.291719 : looking for messages on channels
 10.291731 on 0: Getting JSON message 0
 10.291739 on 0: Invoking channel callback 10_define
 10.322513 SEND on 0(in): '[41,["function","autocommand:0",[{"Num":2,"Name":"/home/caleb/p/xxhash/xxhash_test.go","Contents":"package xxhash\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"hash/fnv\"\n\t\"strings\"\n\t\"testing\"\n\n\tOneOfOne \"github.com/OneOfOne/xxhash\"\n\t\"github.com/spaolacci/murmur3\"\n)\n\nfunc TestAll(t *testing.T) {\n\tfor _, tt := range []struct {\n\t\tname  string\n\t\tinput string\n\t\twant  uint64\n\t}{\n\t\t{\"empty\", \"\", 0xef46db3751d8e999},\n\t\t{\"a\", \"a\", 0xd24ec4f1a98c6e5b},\n\t\t{\"as\", \"as\", 0x1c330fb2d66be179},\n\t\t{\"asd\", \"asd\", 0x631c37ce72a97393},\n\t\t{\"asdf\", \"asdf\", 0x415872f599cea71e},\n\t\t{\n\t\t\t\"len=63\",\n\t\t\t// Exactly 63 characters, which exercises all code paths.\n\t\t\t\"Call me Ishmael. Some years ago--never mind how long precisely-\",\n\t\t\t0x02a2e85470d6fd96,\n\t\t},\n\t} {\n\t\tfor chunkSize := 1; chunkSize <= len(tt.input); chunkSize++ {\n\t\t\tname := fmt.Sprintf(\"%s,chunkSize=%d\", tt.name, chunkSize)\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\ttestDigest(t, tt.input, chunkSize, tt.want)\n\t\t\t})\n\t\t}\n\t\tt.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) })\n\t}\n}\n\nfunc testDigest(t *testing.T, input string, chunkSize int, want uint64) {\n\td := New()\n\tds := New() // uses WriteString\n\tfor i := 0; i < len(input); i += chunkSize {\n\t\tchunk := input[i:]\n\t\tif len(chunk) > chunkSize {\n\t\t\tchunk = chunk[:chunkSize]\n\t\t}\n\t\tn, err := d.Write([]byte(chunk))\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf(\"Digest.Write: got (%d, %v); want (%d, nil)\", n, err, len(chunk))\n\t\t}\n\t\tn, err = ds.WriteString(chunk)\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf(\"Digest.WriteString: got (%d, %v); want (%d, nil)\", n, err, len(chunk))\n\t\t}\n\t}\n\tif got := d.Sum64(); got != want {\n\t\tt.Fatalf(\"Digest.Sum64: got 0x%x; want 0x%x\", got, want)\n\t}\n\tif got := ds.Sum64(); got != want {\n\t\tt.Fatalf(\"Digest.Sum64 (WriteString): got 0x%x; want 0x%x\", got, want)\n\t}\n\tvar b [8]byte\n\tbinary.BigEndian.PutUint64(b[:], want)\n\tif got := d.Sum(nil); !bytes.Equal(got, b[:]) {\n\t\tt.Fatalf(\"Sum: got %v; want %v\", got, b[:])\n\t}\n}\n\nfunc testSum(t *testing.T, input string, want uint64) {\n\tif got := Sum64([]byte(input)); got != want {\n\t\tt.Fatalf(\"Sum64: got 0x%x; want 0x%x\", got, want)\n\t}\n\tif got := Sum64String(input); got != want {\n\t\tt.Fatalf(\"Sum64String: got 0x%x; want 0x%x\", got, want)\n\t}\n}\n\nfunc TestReset(t *testing.T) {\n\tparts := []string{\"The quic\", \"k br\", \"o\", \"wn fox jumps\", \" ov\", \"er the lazy \", \"dog.\"}\n\td := New()\n\tfor _, part := range parts {\n\t\td.Write([]byte(part))\n\t}\n\th0 := d.Sum64()\n\n\td.Reset()\n\td.Write([]byte(strings.Join(parts, \"\")))\n\th1 := d.Sum64()\n\n\tif h0 != h1 {\n\t\tt.Errorf(\"0x%x != 0x%x\", h0, h1)\n\t}\n}\n\nfunc TestBinaryMarshaling(t *testing.T) {\n\td := New()\n\td.WriteString(\"abc\")\n\tb, err := d.MarshalBinary()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\td = New()\n\td.WriteString(\"junk\")\n\tif err := d.UnmarshalBinary(b); err != nil {\n\t\tt.Fatal(err)\n\t}\n\td.WriteString(\"def\")\n\tif got, want := d.Sum64(), Sum64String(\"abcdef\"); got != want {\n\t\tt.Fatalf(\"after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x\", got, want)\n\t}\n\n\td0 := New()\n\td1 := New()\n\tfor i := 0; i < 64; i++ {\n\t\tb, err := d0.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\td0 = new(Digest)\n\t\tif err := d0.UnmarshalBinary(b); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif got, want := d0.Sum64(), d1.Sum64(); got != want {\n\t\t\tt.Fatalf(\"after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x\", i, got, want)\n\t\t}\n\n\t\td0.Write([]byte{'a'})\n\t\td1.Write([]byte{'a'})\n\t}\n}\n\nfunc TestAllocs(t *testing.T) {\n\tconst shortStr = \"abcdefghijklmnop\"\n\t// Sum64([]byte(shortString)) shouldn't allocate because the\n\t// intermediate []byte ought not to escape.\n\t// (See https://github.com/cespare/xxhash/pull/2.)\n\tt.Run(\"Sum64\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64([]byte(shortStr))\n\t\t})\n\t})\n\t// Creating and using a Digest shouldn't allocate because its methods\n\t// shouldn't make it escape. (A previous version of New returned a\n\t// hash.Hash64 which forces an allocation.)\n\tt.Run(\"Digest\", func(t *testing.T) {\n\t\tb := []byte(\"asdf\")\n\t\ttestAllocs(t, func() {\n\t\t\td := New()\n\t\t\td.Write(b)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n\nfunc testAllocs(t *testing.T, fn func()) {\n\tt.Helper()\n\tif allocs := int(testing.AllocsPerRun(10, fn)); allocs > 0 {\n\t\tt.Fatalf(\"got %d allocation(s) (want zero)\", allocs)\n\t}\n}\n\nvar sink uint64\n\nvar benchmarks = []struct {\n\tname         string\n\tdirectBytes  func([]byte) uint64\n\tdirectString func(string) uint64\n\tdigestBytes  func([]byte) uint64\n\tdigestString func(string) uint64\n}{\n\t{\n\t\tname:         \"xxhash\",\n\t\tdirectBytes:  Sum64,\n\t\tdirectString: Sum64String,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := New()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := New()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:         \"OneOfOne\",\n\t\tdirectBytes:  OneOfOne.Checksum64,\n\t\tdirectString: OneOfOne.ChecksumString64,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:        \"murmur3\",\n\t\tdirectBytes: murmur3.Sum64,\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn murmur3.Sum64([]byte(s))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname: \"CRC-32\",\n\t\tdirectBytes: func(b []byte) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE(b))\n\t\t},\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE([]byte(s)))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write(b)\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write([]byte(s))\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t},\n\t{\n\t\tname: \"FNV-1a\",\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := fnv.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := fnv.New64a()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n}\n\nfunc BenchmarkHashes(b *testing.B) {\n\tfor _, bb := range benchmarks {\n\t\tfor _, benchSize := range []struct {\n\t\t\tname string\n\t\t\tn    int\n\t\t}{\n\t\t\t{\"5B\", 5},\n\t\t\t{\"100B\", 100},\n\t\t\t{\"4KB\", 4e3},\n\t\t\t{\"10MB\", 10e6},\n\t\t} {\n\t\t\tinput := make([]byte, benchSize.n)\n\t\t\tfor i := range input {\n\t\t\t\tinput[i] = byte(i)\n\t\t\t}\n\t\t\tinputString := string(input)\n\t\t\tif bb.directBytes != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,direct,bytes,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.directBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.directString != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,direct,string,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.directString)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestBytes != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,digest,bytes,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.digestBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestString != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,digest,string,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.digestString)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc benchmarkHashBytes(b *testing.B, input []byte, fn func([]byte) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i < b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n\nfunc benchmarkHashString(b *testing.B, input string, fn func(string) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i < b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n"}]]]
'
 10.322546 on 0: Blocking read JSON for id 41
 10.322550 : looking for messages on channels
 10.322560 on 0: Waiting for up to 30000 msec
 10.323575 RECV on 0(out): '[0,[39,"call","listener_add","GOVIM_internal_EnrichDelta",2]]
'
 10.323585 : looking for messages on channels
 10.323596 on 0: Getting JSON message 0
 10.323601 on 0: Invoking channel callback 10_define
 10.323736 SEND on 0(in): '[42,["callback",39,["",2]]]
'
 10.323756 : looking for messages on channels
 10.323759 on 0: Waiting for up to 30000 msec
 10.325987 RECV on 0(out): '[41,["",null]]
'
 10.325997 on 0: Getting JSON message 41
 10.326006 on 0: Received JSON for id 41
 10.326583 SEND on 0(in): '[43,["callback",38,[""]]]
'
 10.326604 : looking for messages on channels
 10.326609 on 0: Waiting for up to 30000 msec
 10.326765 RECV on 0(out): '[0,[40,"call","bufnr","/home/caleb/p/xxhash/xxhash_test.go"]]
'
 10.326773 : looking for messages on channels
 10.326781 on 0: Getting JSON message 0
 10.326785 on 0: Invoking channel callback 10_define
 10.326907 SEND on 0(in): '[44,["callback",40,["",2]]]
'
 10.326919 : looking for messages on channels
 10.326922 on 0: Waiting for up to 30000 msec
 10.327146 RECV on 0(out): '[0,[41,"call","getbufinfo","/home/caleb/p/xxhash/xxhash_unsafe_test.go"]]
'
 10.327152 : looking for messages on channels
 10.327156 on 0: Getting JSON message 0
 10.327159 on 0: Invoking channel callback 10_define
 10.327345 SEND on 0(in): '[45,["callback",41,["",[]]]]
'
 10.327357 : looking for messages on channels
 10.327360 on 0: Waiting for up to 30000 msec
 10.327420 RECV on 0(out): '[0,[42,"ex"," split /home/caleb/p/xxhash/xxhash_unsafe_test.go"]]
'
 10.327425 : looking for messages on channels
 10.327429 on 0: Getting JSON message 0
 10.327432 on 0: Invoking channel callback 10_define
 10.363382 SEND on 0(in): '[46,["function","autocommand:0",[{"Num":3,"Name":"/home/caleb/p/xxhash/xxhash_unsafe_test.go","Contents":"// +build !appengine\n\npackage xxhash\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestStringAllocs(t *testing.T) {\n\tlongStr := strings.Repeat(\"a\", 1000)\n\tt.Run(\"Sum64String\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64String(longStr)\n\t\t})\n\t})\n\tt.Run(\"Digest.WriteString\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\td := New()\n\t\t\td.WriteString(longStr)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n"}]]]
'
 10.363405 on 0: Blocking read JSON for id 46
 10.363410 : looking for messages on channels
 10.363421 on 0: Waiting for up to 30000 msec
 10.363710 RECV on 0(out): '[0,[43,"call","listener_add","GOVIM_internal_EnrichDelta",3]]
'
 10.363716 : looking for messages on channels
 10.363721 on 0: Getting JSON message 0
 10.363724 on 0: Invoking channel callback 10_define
 10.363854 SEND on 0(in): '[47,["callback",43,["",3]]]
'
 10.363880 : looking for messages on channels
 10.363889 on 0: Waiting for up to 30000 msec
 10.364232 RECV on 0(out): '[46,["",null]]
'
 10.364238 on 0: Getting JSON message 46
 10.364242 on 0: Received JSON for id 46
 10.364730 SEND on 0(in): '[48,["callback",42,[""]]]
'
 10.364745 : looking for messages on channels
 10.364748 on 0: Waiting for up to 30000 msec
 10.364849 RECV on 0(out): '[0,[44,"call","bufnr","/home/caleb/p/xxhash/xxhash_unsafe_test.go"]]
'
 10.364854 : looking for messages on channels
 10.364858 on 0: Getting JSON message 0
 10.364861 on 0: Invoking channel callback 10_define
 10.364972 SEND on 0(in): '[49,["callback",44,["",3]]]
'
 10.364983 : looking for messages on channels
 10.364986 on 0: Waiting for up to 30000 msec
 10.365113 RECV on 0(out): '[0,[45,"call","win_gotoid",1000]]
'
 10.365117 : looking for messages on channels
 10.365121 on 0: Getting JSON message 0
 10.365124 on 0: Invoking channel callback 10_define
 10.380010 SEND on 0(in): '[50,["callback",45,["",1]]]
'
 10.380046 : looking for messages on channels
 10.380050 on 0: Waiting for up to 30000 msec
 10.380339 RECV on 0(out): '[0,[46,"ex","wundo! /tmp/1566252820354460255014293615"]]
'
 10.380350 : looking for messages on channels
 10.380355 on 0: Getting JSON message 0
 10.380358 on 0: Invoking channel callback 10_define
 10.380550 SEND on 0(in): '[51,["callback",46,[""]]]
'
 10.380561 : looking for messages on channels
 10.380565 on 0: Waiting for up to 30000 msec
 10.380719 RECV on 0(out): '[0,[47,"expr","\u0026eventignore"]]
'
 10.380725 : looking for messages on channels
 10.380737 on 0: Getting JSON message 0
 10.380740 on 0: Invoking channel callback 10_define
 10.380856 SEND on 0(in): '[52,["callback",47,["",""]]]
'
 10.380866 : looking for messages on channels
 10.380869 on 0: Waiting for up to 30000 msec
 10.381022 RECV on 0(out): '[0,[48,"ex","set eventignore=all"]]
'
 10.381026 : looking for messages on channels
 10.381030 on 0: Getting JSON message 0
 10.381032 on 0: Invoking channel callback 10_define
 10.381130 SEND on 0(in): '[53,["callback",48,[""]]]
'
 10.381139 : looking for messages on channels
 10.381143 on 0: Waiting for up to 30000 msec
 10.381224 RECV on 0(out): '[0,[49,"call","listener_remove",1]]
'
 10.381228 : looking for messages on channels
 10.381231 on 0: Getting JSON message 0
 10.381234 on 0: Invoking channel callback 10_define
 10.381326 SEND on 0(in): '[54,["callback",49,["",1]]]
'
 10.381335 : looking for messages on channels
 10.381338 on 0: Waiting for up to 30000 msec
 10.381479 RECV on 0(out): '[0,[50,"call","s:batchCall",[["call","s:mustBeZero","setbufline",1,45,"func NewABC() *Digest {"],["call","s:mustBeZero","setbufline",1,44,"// NewABC creates a new Digest that computes the 64-bit xxHash algorithm."],["call","s:mustBeZero","listener_flush",1],["expr","s:mustNothing","join(getbufline(1, 0, \"$\"), \"\\n\").\"\\n\""]]]]
'
 10.381491 : looking for messages on channels
 10.381495 on 0: Getting JSON message 0
 10.381498 on 0: Invoking channel callback 10_define
 10.381986 SEND on 0(in): '[55,["callback",50,["",[0,0,0,"// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described\n// at http://cyan4973.github.io/xxHash/.\npackage xxhash\n\nimport (\n\t\"encoding/binary\"\n\t\"errors\"\n\t\"math/bits\"\n)\n\nconst (\n\tprime1 uint64 = 11400714785074694791\n\tprime2 uint64 = 14029467366897019727\n\tprime3 uint64 = 1609587929392839161\n\tprime4 uint64 = 9650029242287828579\n\tprime5 uint64 = 2870177450012600261\n)\n\n// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where\n// possible in the Go code is worth a small (but measurable) performance boost\n// by avoiding some MOVQs. Vars are needed for the asm and also are useful for\n// convenience in the Go code in a few places where we need to intentionally\n// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the\n// result overflows a uint64).\nvar (\n\tprime1v = prime1\n\tprime2v = prime2\n\tprime3v = prime3\n\tprime4v = prime4\n\tprime5v = prime5\n)\n\n// Digest implements hash.Hash64.\ntype Digest struct {\n\tv1    uint64\n\tv2    uint64\n\tv3    uint64\n\tv4    uint64\n\ttotal uint64\n\tmem   [32]byte\n\tn     int // how much of mem is used\n}\n\n// NewABC creates a new Digest that computes the 64-bit xxHash algorithm.\nfunc NewABC() *Digest {\n\tvar d Digest\n\td.Reset()\n\treturn &d\n}\n\n// Reset clears the Digest's state so that it can be reused.\nfunc (d *Digest) Reset() {\n\td.v1 = prime1v + prime2\n\td.v2 = prime2\n\td.v3 = 0\n\td.v4 = -prime1v\n\td.total = 0\n\td.n = 0\n}\n\n// Size always returns 8 bytes.\nfunc (d *Digest) Size() int { return 8 }\n\n// BlockSize always returns 32 bytes.\nfunc (d *Digest) BlockSize() int { return 32 }\n\n// Write adds more data to d. It always returns len(b), nil.\nfunc (d *Digest) Write(b []byte) (n int, err error) {\n\tn = len(b)\n\td.total += uint64(n)\n\n\tif d.n+n < 32 {\n\t\t// This new data doesn't even fill the current block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.n += n\n\t\treturn\n\t}\n\n\tif d.n > 0 {\n\t\t// Finish off the partial block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.v1 = round(d.v1, u64(d.mem[0:8]))\n\t\td.v2 = round(d.v2, u64(d.mem[8:16]))\n\t\td.v3 = round(d.v3, u64(d.mem[16:24]))\n\t\td.v4 = round(d.v4, u64(d.mem[24:32]))\n\t\tb = b[32-d.n:]\n\t\td.n = 0\n\t}\n\n\tif len(b) >= 32 {\n\t\t// One or more full blocks left.\n\t\tnw := writeBlocks(d, b)\n\t\tb = b[nw:]\n\t}\n\n\t// Store any remaining partial block.\n\tcopy(d.mem[:], b)\n\td.n = len(b)\n\n\treturn\n}\n\n// Sum appends the current hash to b and returns the resulting slice.\nfunc (d *Digest) Sum(b []byte) []byte {\n\ts := d.Sum64()\n\treturn append(\n\t\tb,\n\t\tbyte(s>>56),\n\t\tbyte(s>>48),\n\t\tbyte(s>>40),\n\t\tbyte(s>>32),\n\t\tbyte(s>>24),\n\t\tbyte(s>>16),\n\t\tbyte(s>>8),\n\t\tbyte(s),\n\t)\n}\n\n// Sum64 returns the current hash.\nfunc (d *Digest) Sum64() uint64 {\n\tvar h uint64\n\n\tif d.total >= 32 {\n\t\tv1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4\n\t\th = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)\n\t\th = mergeRound(h, v1)\n\t\th = mergeRound(h, v2)\n\t\th = mergeRound(h, v3)\n\t\th = mergeRound(h, v4)\n\t} else {\n\t\th = d.v3 + prime5\n\t}\n\n\th += d.total\n\n\ti, end := 0, d.n\n\tfor ; i+8 <= end; i += 8 {\n\t\tk1 := round(0, u64(d.mem[i:i+8]))\n\t\th ^= k1\n\t\th = rol27(h)*prime1 + prime4\n\t}\n\tif i+4 <= end {\n\t\th ^= uint64(u32(d.mem[i:i+4])) * prime1\n\t\th = rol23(h)*prime2 + prime3\n\t\ti += 4\n\t}\n\tfor i < end {\n\t\th ^= uint64(d.mem[i]) * prime5\n\t\th = rol11(h) * prime1\n\t\ti++\n\t}\n\n\th ^= h >> 33\n\th *= prime2\n\th ^= h >> 29\n\th *= prime3\n\th ^= h >> 32\n\n\treturn h\n}\n\nconst (\n\tmagic         = \"xxh\\x06\"\n\tmarshaledSize = len(magic) + 8*5 + 32\n)\n\n// MarshalBinary implements the encoding.BinaryMarshaler interface.\nfunc (d *Digest) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 0, marshaledSize)\n\tb = append(b, magic...)\n\tb = appendUint64(b, d.v1)\n\tb = appendUint64(b, d.v2)\n\tb = appendUint64(b, d.v3)\n\tb = appendUint64(b, d.v4)\n\tb = appendUint64(b, d.total)\n\tb = append(b, d.mem[:d.n]...)\n\tb = b[:len(b)+len(d.mem)-d.n]\n\treturn b, nil\n}\n\n// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.\nfunc (d *Digest) UnmarshalBinary(b []byte) error {\n\tif len(b) < len(magic) || string(b[:len(magic)]) != magic {\n\t\treturn errors.New(\"xxhash: invalid hash state identifier\")\n\t}\n\tif len(b) != marshaledSize {\n\t\treturn errors.New(\"xxhash: invalid hash state size\")\n\t}\n\tb = b[len(magic):]\n\tb, d.v1 = consumeUint64(b)\n\tb, d.v2 = consumeUint64(b)\n\tb, d.v3 = consumeUint64(b)\n\tb, d.v4 = consumeUint64(b)\n\tb, d.total = consumeUint64(b)\n\tcopy(d.mem[:], b)\n\tb = b[len(d.mem):]\n\td.n = int(d.total % uint64(len(d.mem)))\n\treturn nil\n}\n\nfunc appendUint64(b []byte, x uint64) []byte {\n\tvar a [8]byte\n\tbinary.LittleEndian.PutUint64(a[:], x)\n\treturn append(b, a[:]...)\n}\n\nfunc consumeUint64(b []byte) ([]byte, uint64) {\n\tx := u64(b)\n\treturn b[8:], x\n}\n\nfunc u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }\nfunc u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }\n\nfunc round(acc, input uint64) uint64 {\n\tacc += input * prime2\n\tacc = rol31(acc)\n\tacc *= prime1\n\treturn acc\n}\n\nfunc mergeRound(acc, val uint64) uint64 {\n\tval = round(0, val)\n\tacc ^= val\n\tacc = acc*prime1 + prime4\n\treturn acc\n}\n\nfunc rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }\nfunc rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }\nfunc rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }\nfunc rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }\nfunc rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }\nfunc rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }\nfunc rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }\nfunc rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }\n"]]]]
'
 10.382014 : looking for messages on channels
 10.382018 on 0: Waiting for up to 30000 msec
 10.384623 RECV on 0(out): '[0,[51,"call","listener_add","GOVIM_internal_EnrichDelta",1]]
'
 10.384641 : looking for messages on channels
 10.384651 on 0: Getting JSON message 0
 10.384655 on 0: Invoking channel callback 10_define
 10.384790 SEND on 0(in): '[56,["callback",51,["",4]]]
'
 10.384805 : looking for messages on channels
 10.384809 on 0: Waiting for up to 30000 msec
 10.384929 RECV on 0(out): '[0,[52,"ex","set eventignore="]]
'
 10.384937 : looking for messages on channels
 10.384946 on 0: Getting JSON message 0
 10.384950 on 0: Invoking channel callback 10_define
 10.385063 SEND on 0(in): '[57,["callback",52,[""]]]
'
 10.385076 : looking for messages on channels
 10.385079 on 0: Waiting for up to 30000 msec
 10.385331 RECV on 0(out): '[0,[53,"ex","wundo! /tmp/1566252820359494526643593474"]]
'
 10.385339 : looking for messages on channels
 10.385345 on 0: Getting JSON message 0
 10.385348 on 0: Invoking channel callback 10_define
 10.385621 SEND on 0(in): '[58,["callback",53,[""]]]
'
 10.385633 : looking for messages on channels
 10.385637 on 0: Waiting for up to 30000 msec
 10.385749 RECV on 0(out): '[0,[54,"expr","\u0026eventignore"]]
'
 10.385754 : looking for messages on channels
 10.385757 on 0: Getting JSON message 0
 10.385760 on 0: Invoking channel callback 10_define
 10.385854 SEND on 0(in): '[59,["callback",54,["",""]]]
'
 10.385865 : looking for messages on channels
 10.385868 on 0: Waiting for up to 30000 msec
 10.385975 RECV on 0(out): '[0,[55,"ex","set eventignore=all"]]
'
 10.385979 : looking for messages on channels
 10.385983 on 0: Getting JSON message 0
 10.385985 on 0: Invoking channel callback 10_define
 10.386081 SEND on 0(in): '[60,["callback",55,[""]]]
'
 10.386090 : looking for messages on channels
 10.386093 on 0: Waiting for up to 30000 msec
 10.386165 RECV on 0(out): '[0,[56,"call","listener_remove",2]]
'
 10.386170 : looking for messages on channels
 10.386175 on 0: Getting JSON message 0
 10.386179 on 0: Invoking channel callback 10_define
 10.386281 SEND on 0(in): '[61,["callback",56,["",1]]]
'
 10.386291 : looking for messages on channels
 10.386294 on 0: Waiting for up to 30000 msec
 10.386443 RECV on 0(out): '[0,[57,"call","s:batchCall",[["call","s:mustBeZero","setbufline",2,186,"\t\t\th := NewABC()"],["call","s:mustBeZero","setbufline",2,181,"\t\t\th := NewABC()"],["call","s:mustBeZero","setbufline",2,153,"\t\t\td := NewABC()"],["call","s:mustBeZero","setbufline",2,118,"\td1 := NewABC()"],["call","s:mustBeZero","setbufline",2,117,"\td0 := NewABC()"],["call","s:mustBeZero","setbufline",2,107,"\td = NewABC()"],["call","s:mustBeZero","setbufline",2,101,"\td := NewABC()"],["call","s:mustBeZero","setbufline",2,85,"\td := NewABC()"],["call","s:mustBeZero","setbufline",2,46,"\tds := NewABC() // uses WriteString"],["call","s:mustBeZero","setbufline",2,45,"\td := NewABC()"],["call","s:mustBeZero","listener_flush",2],["expr","s:mustNothing","join(getbufline(2, 0, \"$\"), \"\\n\").\"\\n\""]]]]
'
 10.386463 : looking for messages on channels
 10.386467 on 0: Getting JSON message 0
 10.386470 on 0: Invoking channel callback 10_define
 10.387371 SEND on 0(in): '[62,["callback",57,["",[0,0,0,0,0,0,0,0,0,0,0,"package xxhash\n\nimport (\n\t\"bytes\"\n\t\"encoding/binary\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"hash/fnv\"\n\t\"strings\"\n\t\"testing\"\n\n\tOneOfOne \"github.com/OneOfOne/xxhash\"\n\t\"github.com/spaolacci/murmur3\"\n)\n\nfunc TestAll(t *testing.T) {\n\tfor _, tt := range []struct {\n\t\tname  string\n\t\tinput string\n\t\twant  uint64\n\t}{\n\t\t{\"empty\", \"\", 0xef46db3751d8e999},\n\t\t{\"a\", \"a\", 0xd24ec4f1a98c6e5b},\n\t\t{\"as\", \"as\", 0x1c330fb2d66be179},\n\t\t{\"asd\", \"asd\", 0x631c37ce72a97393},\n\t\t{\"asdf\", \"asdf\", 0x415872f599cea71e},\n\t\t{\n\t\t\t\"len=63\",\n\t\t\t// Exactly 63 characters, which exercises all code paths.\n\t\t\t\"Call me Ishmael. Some years ago--never mind how long precisely-\",\n\t\t\t0x02a2e85470d6fd96,\n\t\t},\n\t} {\n\t\tfor chunkSize := 1; chunkSize <= len(tt.input); chunkSize++ {\n\t\t\tname := fmt.Sprintf(\"%s,chunkSize=%d\", tt.name, chunkSize)\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\ttestDigest(t, tt.input, chunkSize, tt.want)\n\t\t\t})\n\t\t}\n\t\tt.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) })\n\t}\n}\n\nfunc testDigest(t *testing.T, input string, chunkSize int, want uint64) {\n\td := NewABC()\n\tds := NewABC() // uses WriteString\n\tfor i := 0; i < len(input); i += chunkSize {\n\t\tchunk := input[i:]\n\t\tif len(chunk) > chunkSize {\n\t\t\tchunk = chunk[:chunkSize]\n\t\t}\n\t\tn, err := d.Write([]byte(chunk))\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf(\"Digest.Write: got (%d, %v); want (%d, nil)\", n, err, len(chunk))\n\t\t}\n\t\tn, err = ds.WriteString(chunk)\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf(\"Digest.WriteString: got (%d, %v); want (%d, nil)\", n, err, len(chunk))\n\t\t}\n\t}\n\tif got := d.Sum64(); got != want {\n\t\tt.Fatalf(\"Digest.Sum64: got 0x%x; want 0x%x\", got, want)\n\t}\n\tif got := ds.Sum64(); got != want {\n\t\tt.Fatalf(\"Digest.Sum64 (WriteString): got 0x%x; want 0x%x\", got, want)\n\t}\n\tvar b [8]byte\n\tbinary.BigEndian.PutUint64(b[:], want)\n\tif got := d.Sum(nil); !bytes.Equal(got, b[:]) {\n\t\tt.Fatalf(\"Sum: got %v; want %v\", got, b[:])\n\t}\n}\n\nfunc testSum(t *testing.T, input string, want uint64) {\n\tif got := Sum64([]byte(input)); got != want {\n\t\tt.Fatalf(\"Sum64: got 0x%x; want 0x%x\", got, want)\n\t}\n\tif got := Sum64String(input); got != want {\n\t\tt.Fatalf(\"Sum64String: got 0x%x; want 0x%x\", got, want)\n\t}\n}\n\nfunc TestReset(t *testing.T) {\n\tparts := []string{\"The quic\", \"k br\", \"o\", \"wn fox jumps\", \" ov\", \"er the lazy \", \"dog.\"}\n\td := NewABC()\n\tfor _, part := range parts {\n\t\td.Write([]byte(part))\n\t}\n\th0 := d.Sum64()\n\n\td.Reset()\n\td.Write([]byte(strings.Join(parts, \"\")))\n\th1 := d.Sum64()\n\n\tif h0 != h1 {\n\t\tt.Errorf(\"0x%x != 0x%x\", h0, h1)\n\t}\n}\n\nfunc TestBinaryMarshaling(t *testing.T) {\n\td := NewABC()\n\td.WriteString(\"abc\")\n\tb, err := d.MarshalBinary()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\td = NewABC()\n\td.WriteString(\"junk\")\n\tif err := d.UnmarshalBinary(b); err != nil {\n\t\tt.Fatal(err)\n\t}\n\td.WriteString(\"def\")\n\tif got, want := d.Sum64(), Sum64String(\"abcdef\"); got != want {\n\t\tt.Fatalf(\"after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x\", got, want)\n\t}\n\n\td0 := NewABC()\n\td1 := NewABC()\n\tfor i := 0; i < 64; i++ {\n\t\tb, err := d0.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\td0 = new(Digest)\n\t\tif err := d0.UnmarshalBinary(b); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif got, want := d0.Sum64(), d1.Sum64(); got != want {\n\t\t\tt.Fatalf(\"after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x\", i, got, want)\n\t\t}\n\n\t\td0.Write([]byte{'a'})\n\t\td1.Write([]byte{'a'})\n\t}\n}\n\nfunc TestAllocs(t *testing.T) {\n\tconst shortStr = \"abcdefghijklmnop\"\n\t// Sum64([]byte(shortString)) shouldn't allocate because the\n\t// intermediate []byte ought not to escape.\n\t// (See https://github.com/cespare/xxhash/pull/2.)\n\tt.Run(\"Sum64\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64([]byte(shortStr))\n\t\t})\n\t})\n\t// Creating and using a Digest shouldn't allocate because its methods\n\t// shouldn't make it escape. (A previous version of New returned a\n\t// hash.Hash64 which forces an allocation.)\n\tt.Run(\"Digest\", func(t *testing.T) {\n\t\tb := []byte(\"asdf\")\n\t\ttestAllocs(t, func() {\n\t\t\td := NewABC()\n\t\t\td.Write(b)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n\nfunc testAllocs(t *testing.T, fn func()) {\n\tt.Helper()\n\tif allocs := int(testing.AllocsPerRun(10, fn)); allocs > 0 {\n\t\tt.Fatalf(\"got %d allocation(s) (want zero)\", allocs)\n\t}\n}\n\nvar sink uint64\n\nvar benchmarks = []struct {\n\tname         string\n\tdirectBytes  func([]byte) uint64\n\tdirectString func(string) uint64\n\tdigestBytes  func([]byte) uint64\n\tdigestString func(string) uint64\n}{\n\t{\n\t\tname:         \"xxhash\",\n\t\tdirectBytes:  Sum64,\n\t\tdirectString: Sum64String,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := NewABC()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := NewABC()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:         \"OneOfOne\",\n\t\tdirectBytes:  OneOfOne.Checksum64,\n\t\tdirectString: OneOfOne.ChecksumString64,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:        \"murmur3\",\n\t\tdirectBytes: murmur3.Sum64,\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn murmur3.Sum64([]byte(s))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname: \"CRC-32\",\n\t\tdirectBytes: func(b []byte) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE(b))\n\t\t},\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE([]byte(s)))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write(b)\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write([]byte(s))\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t},\n\t{\n\t\tname: \"FNV-1a\",\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := fnv.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := fnv.New64a()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n}\n\nfunc BenchmarkHashes(b *testing.B) {\n\tfor _, bb := range benchmarks {\n\t\tfor _, benchSize := range []struct {\n\t\t\tname string\n\t\t\tn    int\n\t\t}{\n\t\t\t{\"5B\", 5},\n\t\t\t{\"100B\", 100},\n\t\t\t{\"4KB\", 4e3},\n\t\t\t{\"10MB\", 10e6},\n\t\t} {\n\t\t\tinput := make([]byte, benchSize.n)\n\t\t\tfor i := range input {\n\t\t\t\tinput[i] = byte(i)\n\t\t\t}\n\t\t\tinputString := string(input)\n\t\t\tif bb.directBytes != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,direct,bytes,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.directBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.directString != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,direct,string,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.directString)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestBytes != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,digest,bytes,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.digestBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestString != nil {\n\t\t\t\tname := fmt.Sprintf(\"%s,digest,string,n=%s\", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.digestString)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc benchmarkHashBytes(b *testing.B, input []byte, fn func([]byte) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i < b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n\nfunc benchmarkHashString(b *testing.B, input string, fn func(string) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i < b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n"]]]]
'
 10.387405 : looking for messages on channels
 10.387409 on 0: Waiting for up to 30000 msec
 10.390904 RECV on 0(out): '[0,[58,"call","listener_add","GOVIM_internal_EnrichDelta",2]]
'
 10.390921 : looking for messages on channels
 10.390927 on 0: Getting JSON message 0
 10.390930 on 0: Invoking channel callback 10_define
 10.391053 SEND on 0(in): '[63,["callback",58,["",5]]]
'
 10.391081 : looking for messages on channels
 10.391085 on 0: Waiting for up to 30000 msec
 10.391215 RECV on 0(out): '[0,[59,"ex","set eventignore="]]
'
 10.391221 : looking for messages on channels
 10.391225 on 0: Getting JSON message 0
 10.391228 on 0: Invoking channel callback 10_define
 10.391323 SEND on 0(in): '[64,["callback",59,[""]]]
'
 10.391334 : looking for messages on channels
 10.391338 on 0: Waiting for up to 30000 msec
 10.391478 RECV on 0(out): '[0,[60,"ex","silent! rundo /tmp/1566252820359494526643593474"]]
'
 10.391483 : looking for messages on channels
 10.391487 on 0: Getting JSON message 0
 10.391490 on 0: Invoking channel callback 10_define
 10.391675 SEND on 0(in): '[65,["callback",60,[""]]]
'
 10.391688 : looking for messages on channels
 10.391691 on 0: Waiting for up to 30000 msec
 10.391849 RECV on 0(out): '[0,[61,"ex","wundo! /tmp/1566252820366030578302475897"]]
'
 10.391857 : looking for messages on channels
 10.391862 on 0: Getting JSON message 0
 10.391865 on 0: Invoking channel callback 10_define
 10.392088 SEND on 0(in): '[66,["callback",61,[""]]]
'
 10.392100 : looking for messages on channels
 10.392103 on 0: Waiting for up to 30000 msec
 10.392180 RECV on 0(out): '[0,[62,"expr","\u0026eventignore"]]
'
 10.392186 : looking for messages on channels
 10.392190 on 0: Getting JSON message 0
 10.392192 on 0: Invoking channel callback 10_define
 10.392290 SEND on 0(in): '[67,["callback",62,["",""]]]
'
 10.392302 : looking for messages on channels
 10.392305 on 0: Waiting for up to 30000 msec
 10.392364 RECV on 0(out): '[0,[63,"ex","set eventignore=all"]]
'
 10.392370 : looking for messages on channels
 10.392374 on 0: Getting JSON message 0
 10.392377 on 0: Invoking channel callback 10_define
 10.392489 SEND on 0(in): '[68,["callback",63,[""]]]
'
 10.392500 : looking for messages on channels
 10.392503 on 0: Waiting for up to 30000 msec
 10.392632 RECV on 0(out): '[0,[64,"call","listener_remove",3]]
'
 10.392640 : looking for messages on channels
 10.392649 on 0: Getting JSON message 0
 10.392654 on 0: Invoking channel callback 10_define
 10.392772 SEND on 0(in): '[69,["callback",64,["",1]]]
'
 10.392784 : looking for messages on channels
 10.392788 on 0: Waiting for up to 30000 msec
 10.392883 RECV on 0(out): '[0,[65,"call","s:batchCall",[["call","s:mustBeZero","setbufline",3,19,"\t\t\td := NewABC()"],["call","s:mustBeZero","listener_flush",3],["expr","s:mustNothing","join(getbufline(3, 0, \"$\"), \"\\n\").\"\\n\""]]]]
'
 10.392896 : looking for messages on channels
 10.392900 on 0: Getting JSON message 0
 10.392903 on 0: Invoking channel callback 10_define
 10.393232 SEND on 0(in): '[70,["callback",65,["",[0,0,"// +build !appengine\n\npackage xxhash\n\nimport (\n\t\"strings\"\n\t\"testing\"\n)\n\nfunc TestStringAllocs(t *testing.T) {\n\tlongStr := strings.Repeat(\"a\", 1000)\n\tt.Run(\"Sum64String\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64String(longStr)\n\t\t})\n\t})\n\tt.Run(\"Digest.WriteString\", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\td := NewABC()\n\t\t\td.WriteString(longStr)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n"]]]]
'
 10.393246 : looking for messages on channels
 10.393250 on 0: Waiting for up to 30000 msec
 10.393747 RECV on 0(out): '[0,[66,"call","listener_add","GOVIM_internal_EnrichDelta",3]]
'
 10.393756 : looking for messages on channels
 10.393766 on 0: Getting JSON message 0
 10.393769 on 0: Invoking channel callback 10_define
 10.393879 SEND on 0(in): '[71,["callback",66,["",6]]]
'
 10.393890 : looking for messages on channels
 10.393893 on 0: Waiting for up to 30000 msec
 10.393954 RECV on 0(out): '[0,[67,"ex","set eventignore="]]
'
 10.393961 : looking for messages on channels
 10.393965 on 0: Getting JSON message 0
 10.393968 on 0: Invoking channel callback 10_define
 10.394072 SEND on 0(in): '[72,["callback",67,[""]]]
'
 10.394083 : looking for messages on channels
 10.394087 on 0: Waiting for up to 30000 msec
 10.394236 RECV on 0(out): '[0,[68,"ex","silent! rundo /tmp/1566252820366030578302475897"]]
'
 10.394243 : looking for messages on channels
 10.394247 on 0: Getting JSON message 0
 10.394250 on 0: Invoking channel callback 10_define
 10.394426 SEND on 0(in): '[73,["callback",68,[""]]]
'
 10.394437 : looking for messages on channels
 10.394441 on 0: Waiting for up to 30000 msec
 10.394621 RECV on 0(out): '[34,["",null]]
'
 10.394627 on 0: Getting JSON message 34
 10.394631 on 0: Received JSON for id 34
 10.394798 SEND on 0(in): '[74,["function","function:GOVIM_internal_SetUserBusy",[1]]]
'
 10.394806 on 0: Blocking read JSON for id 74
 10.394809 : looking for messages on channels
 10.394812 on 0: Waiting for up to 30000 msec
 10.394959 RECV on 0(out): '[74,["",null]]
'
 10.394963 on 0: Getting JSON message 74
 10.394968 on 0: Received JSON for id 74
 10.443770 : looking for messages on channels
 10.944764 SEND on 0(in): '[75,["function","function:GOVIM_internal_SetUserBusy",[0]]]
'
 10.944799 on 0: Blocking read JSON for id 75
 10.944807 : looking for messages on channels
 10.944814 on 0: Waiting for up to 30000 msec
 10.945131 RECV on 0(out): '[75,["",null]]
'
 10.945147 on 0: Getting JSON message 75
 10.945156 on 0: Received JSON for id 75
 10.947128 : looking for messages on channels
 12.803037 SEND on 0(in): '[76,["function","autocommand:1",[1]]]
'
 12.803073 on 0: Blocking read JSON for id 76
 12.803082 : looking for messages on channels
 12.803089 on 0: Waiting for up to 30000 msec
 12.821424 RECV on 0(out): '[76,["",null]]
'
 12.821453 on 0: Getting JSON message 76
 12.821474 on 0: Received JSON for id 76
 12.823490 SEND on 0(in): '[77,["function","autocommand:1",[2]]]
'
 12.823511 on 0: Blocking read JSON for id 77
 12.823519 : looking for messages on channels
 12.823525 on 0: Waiting for up to 30000 msec
 12.833918 RECV on 0(out): '[77,["",null]]
'
 12.833931 on 0: Getting JSON message 77
 12.833942 on 0: Received JSON for id 77
 12.835867 SEND on 0(in): '[78,["function","autocommand:1",[3]]]
'
 12.835885 on 0: Blocking read JSON for id 78
 12.835891 : looking for messages on channels
 12.835897 on 0: Waiting for up to 30000 msec
 12.837801 RECV on 0(out): '[78,["",null]]
'
 12.837815 on 0: Getting JSON message 78
 12.837840 on 0: Received JSON for id 78
 12.883023 : Starting job: sh  -c  git status --porcelain -- '/home/caleb/p/xxhash/xxhash.go'
 12.883040 on 2: Created channel
 12.885322 : looking for messages on channels
 12.886222 RECV on 2(out): ' M xxhash.go
'
 12.886229 on 2: Invoking channel callback 99_on_stdout
 12.886397 on 2: channel_select_check(): Read EOF from ch_part[1], closing
 12.886406 : looking for messages on channels
 12.886410 on 2: Closing channel because all readable fds are closed
 12.886412 on 2: Closing channel
 12.886417 on 2: Invoking callbacks and flushing buffers before closing
 12.886420 on 2: Invoking close callback 99_on_exit_untracked
 12.886464 on 2: Job ended
 12.886472 on 2: Freeing job
 12.886476 : looking for messages on channels
 12.886478 on 2: Closing channel
 12.886481 on 2: Clearing channel
 12.886485 on 2: Freeing channel
 12.986628 : looking for messages on channels
 15.847860 SEND on 0(in): '[79,["function","command:GOVIMRename",{"mods":""}]]
'
 15.847906 on 0: Blocking read JSON for id 79
 15.847917 : looking for messages on channels
 15.847925 on 0: Waiting for up to 30000 msec
 15.848244 RECV on 0(out): '[0,[69,"expr","{\"bufnum\": bufnr(\"\"), \"line\": line(\".\"), \"col\": col(\".\")}"]]
'
 15.848270 : looking for messages on channels
 15.848305 on 0: Getting JSON message 0
 15.848312 on 0: Invoking channel callback 10_define
 15.848557 SEND on 0(in): '[80,["callback",69,["",{"bufnum":1,"col":7,"line":45}]]]
'
 15.848593 : looking for messages on channels
 15.848601 on 0: Waiting for up to 30000 msec
 15.848852 RECV on 0(out): '[0,[70,"expr","expand(\"\u003ccword\u003e\")"]]
'
 15.848865 : looking for messages on channels
 15.848874 on 0: Getting JSON message 0
 15.848880 on 0: Invoking channel callback 10_define
 15.849101 SEND on 0(in): '[81,["callback",70,["","NewABC"]]]
'
 15.849123 : looking for messages on channels
 15.849130 on 0: Waiting for up to 30000 msec
 15.849326 RECV on 0(out): '[0,[71,"expr","input(\"govim: rename 'NewABC' to: \", \"NewABC\")"]]
'
 15.849345 : looking for messages on channels
 15.849355 on 0: Getting JSON message 0
 15.849361 on 0: Invoking channel callback 10_define
 15.849627 : looking for messages on channels
 17.408810 SEND on 0(in): '[82,["callback",71,["","NewXYZ"]]]
'
 17.408864 : looking for messages on channels
 17.408873 on 0: Waiting for up to 30000 msec
 17.409975 RECV on 0(out): '[79,["got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC",""]]
'
 17.409990 on 0: Getting JSON message 79
 17.410000 on 0: Received JSON for id 79
 17.410045 : ERROR: Error detected while processing function 10_callbackCommand:
 17.410095 : ERROR: line    5:
 17.410135 : ERROR: E605: Exception not caught: got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC
 17.410218 : looking for messages on channels

govim log snippet
2019-08-19T15:13:42.811986_#1: vim start =======================
2019-08-19T15:13:42.811986_#1: sendJSONMsg: [78,["",null]]
2019-08-19T15:13:42.811986_#1: vim end =======================
2019-08-19T15:13:42.812429_#1: handleEvent: Vim is in charge of /home/caleb/p/xxhash/xxhash_unsafe_test.go; not handling
2019-08-19T15:13:42.812470_#1: handleEvent: Vim is in charge of /home/caleb/p/xxhash/xxhash_unsafe_test.go; not handling
2019-08-19T15:13:42.813433_#1: handleEvent: Vim is in charge of /home/caleb/p/xxhash/xxhash_unsafe_test.go; not handling
2019-08-19T15:13:42.813455_#1: handleEvent: Vim is in charge of /home/caleb/p/xxhash/xxhash_unsafe_test.go; not handling
2019-08-19T15:13:45.822237_#1: vim start =======================
2019-08-19T15:13:45.822237_#1: recvJSONMsg: [79] ["function","command:GOVIMRename",{"mods":""}]
2019-08-19T15:13:45.822237_#1: vim end =======================
2019-08-19T15:13:45.822310_#1: run: waiting to read a JSON message
2019-08-19T15:13:45.822422_#1: vim start =======================
2019-08-19T15:13:45.822422_#1: sendJSONMsg: [0,[69,"expr","{\"bufnum\": bufnr(\"\"), \"line\": line(\".\"), \"col\": col(\".\")}"]]
2019-08-19T15:13:45.822422_#1: vim end =======================
2019-08-19T15:13:45.822847_#1: vim start =======================
2019-08-19T15:13:45.822847_#1: recvJSONMsg: [80] ["callback",69,["",{"bufnum":1,"col":7,"line":45}]]
2019-08-19T15:13:45.822847_#1: vim end =======================
2019-08-19T15:13:45.822904_#1: run: waiting to read a JSON message
2019-08-19T15:13:45.823043_#1: vim start =======================
2019-08-19T15:13:45.823043_#1: sendJSONMsg: [0,[70,"expr","expand(\"\u003ccword\u003e\")"]]
2019-08-19T15:13:45.823043_#1: vim end =======================
2019-08-19T15:13:45.823372_#1: vim start =======================
2019-08-19T15:13:45.823372_#1: recvJSONMsg: [81] ["callback",70,["","NewABC"]]
2019-08-19T15:13:45.823372_#1: vim end =======================
2019-08-19T15:13:45.823410_#1: run: waiting to read a JSON message
2019-08-19T15:13:45.823520_#1: vim start =======================
2019-08-19T15:13:45.823520_#1: sendJSONMsg: [0,[71,"expr","input(\"govim: rename 'NewABC' to: \", \"NewABC\")"]]
2019-08-19T15:13:45.823520_#1: vim end =======================
2019-08-19T15:13:47.383184_#1: vim start =======================
2019-08-19T15:13:47.383184_#1: recvJSONMsg: [82] ["callback",71,["","NewXYZ"]]
2019-08-19T15:13:47.383184_#1: vim end =======================
2019-08-19T15:13:47.383253_#1: run: waiting to read a JSON message
2019-08-19T15:13:47.383436_#1: gopls server start =======================
2019-08-19T15:13:47.383436_#1: gopls.Rename() call; params:
2019-08-19T15:13:47.383436_#1: &protocol.RenameParams{
2019-08-19T15:13:47.383436_#1:     TextDocument: protocol.TextDocumentIdentifier{URI:"file:///home/caleb/p/xxhash/xxhash.go"},
2019-08-19T15:13:47.383436_#1:     Position:     protocol.Position{Line:44, Character:6},
2019-08-19T15:13:47.383436_#1:     NewName:      "NewXYZ",
2019-08-19T15:13:47.383436_#1: }
2019-08-19T15:13:47.383436_#1: gopls server end =======================
2019-08-19T15:13:47.384103_#1: gopls server start =======================
2019-08-19T15:13:47.384103_#1: gopls.Rename() return; err: no object for ident NewABC; res
2019-08-19T15:13:47.384103_#1: gopls server end =======================
2019-08-19T15:13:47.384103_#1: %!(EXTRA string=(*protocol.WorkspaceEdit)(nil))
2019-08-19T15:13:47.384140_#1: got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC
2019-08-19T15:13:47.384175_#1: vim start =======================
2019-08-19T15:13:47.384175_#1: sendJSONMsg: [79,["got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC",""]]
2019-08-19T15:13:47.384175_#1: vim end =======================

gopls log snippet
[Trace - 3:13:40 PM] Received response 'textDocument/rename - (2)' in 0ms.
Params: {"changes":{"file:///home/caleb/p/xxhash/xxhash.go":[{"range":{"start":{"line":43,"character":3},"end":{"line":43,"character":6}},"newText":"NewABC"},{"range":{"start":{"line":44,"character":5},"end":{"line":44,"character":8}},"newText":"NewABC"}],"file:///home/caleb/p/xxhash/xxhash_test.go":[{"range":{"start":{"line":44,"character":6},"end":{"line":44,"character":9}},"newText":"NewABC"},{"range":{"start":{"line":45,"character":7},"end":{"line":45,"character":10}},"newText":"NewABC"},{"range":{"start":{"line":84,"character":6},"end":{"line":84,"character":9}},"newText":"NewABC"},{"range":{"start":{"line":100,"character":6},"end":{"line":100,"character":9}},"newText":"NewABC"},{"range":{"start":{"line":106,"character":5},"end":{"line":106,"character":8}},"newText":"NewABC"},{"range":{"start":{"line":116,"character":7},"end":{"line":116,"character":10}},"newText":"NewABC"},{"range":{"start":{"line":117,"character":7},"end":{"line":117,"character":10}},"newText":"NewABC"},{"range":{"start":{"line":152,"character":8},"end":{"line":152,"character":11}},"newText":"NewABC"},{"range":{"start":{"line":180,"character":8},"end":{"line":180,"character":11}},"newText":"NewABC"},{"range":{"start":{"line":185,"character":8},"end":{"line":185,"character":11}},"newText":"NewABC"}],"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go":[{"range":{"start":{"line":18,"character":8},"end":{"line":18,"character":11}},"newText":"NewABC"}]}}
[Trace - 3:13:40 PM] Sending notification 'textDocument/rename' in 2ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash.go"},"position":{"line":44,"character":6},"newName":"NewABC"}
[Trace - 3:13:40 PM] Sending notification 'textDocument/didOpen' in 0ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash_test.go","languageId":"go","version":0,"text":"package xxhash\n\nimport (\n\t"bytes"\n\t"encoding/binary"\n\t"fmt"\n\t"hash/crc32"\n\t"hash/fnv"\n\t"strings"\n\t"testing"\n\n\tOneOfOne "github.com/OneOfOne/xxhash"\n\t"github.com/spaolacci/murmur3"\n)\n\nfunc TestAll(t *testing.T) {\n\tfor _, tt := range []struct {\n\t\tname  string\n\t\tinput string\n\t\twant  uint64\n\t}{\n\t\t{"empty", "", 0xef46db3751d8e999},\n\t\t{"a", "a", 0xd24ec4f1a98c6e5b},\n\t\t{"as", "as", 0x1c330fb2d66be179},\n\t\t{"asd", "asd", 0x631c37ce72a97393},\n\t\t{"asdf", "asdf", 0x415872f599cea71e},\n\t\t{\n\t\t\t"len=63",\n\t\t\t// Exactly 63 characters, which exercises all code paths.\n\t\t\t"Call me Ishmael. Some years ago--never mind how long precisely-",\n\t\t\t0x02a2e85470d6fd96,\n\t\t},\n\t} {\n\t\tfor chunkSize := 1; chunkSize \u003c= len(tt.input); chunkSize++ {\n\t\t\tname := fmt.Sprintf("%s,chunkSize=%d", tt.name, chunkSize)\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\ttestDigest(t, tt.input, chunkSize, tt.want)\n\t\t\t})\n\t\t}\n\t\tt.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) })\n\t}\n}\n\nfunc testDigest(t *testing.T, input string, chunkSize int, want uint64) {\n\td := New()\n\tds := New() // uses WriteString\n\tfor i := 0; i \u003c len(input); i += chunkSize {\n\t\tchunk := input[i:]\n\t\tif len(chunk) \u003e chunkSize {\n\t\t\tchunk = chunk[:chunkSize]\n\t\t}\n\t\tn, err := d.Write([]byte(chunk))\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf("Digest.Write: got (%d, %v); want (%d, nil)", n, err, len(chunk))\n\t\t}\n\t\tn, err = ds.WriteString(chunk)\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", n, err, len(chunk))\n\t\t}\n\t}\n\tif got := d.Sum64(); got != want {\n\t\tt.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want)\n\t}\n\tif got := ds.Sum64(); got != want {\n\t\tt.Fatalf("Digest.Sum64 (WriteString): got 0x%x; want 0x%x", got, want)\n\t}\n\tvar b [8]byte\n\tbinary.BigEndian.PutUint64(b[:], want)\n\tif got := d.Sum(nil); !bytes.Equal(got, b[:]) {\n\t\tt.Fatalf("Sum: got %v; want %v", got, b[:])\n\t}\n}\n\nfunc testSum(t *testing.T, input string, want uint64) {\n\tif got := Sum64([]byte(input)); got != want {\n\t\tt.Fatalf("Sum64: got 0x%x; want 0x%x", got, want)\n\t}\n\tif got := Sum64String(input); got != want {\n\t\tt.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want)\n\t}\n}\n\nfunc TestReset(t *testing.T) {\n\tparts := []string{"The quic", "k br", "o", "wn fox jumps", " ov", "er the lazy ", "dog."}\n\td := New()\n\tfor _, part := range parts {\n\t\td.Write([]byte(part))\n\t}\n\th0 := d.Sum64()\n\n\td.Reset()\n\td.Write([]byte(strings.Join(parts, "")))\n\th1 := d.Sum64()\n\n\tif h0 != h1 {\n\t\tt.Errorf("0x%x != 0x%x", h0, h1)\n\t}\n}\n\nfunc TestBinaryMarshaling(t *testing.T) {\n\td := New()\n\td.WriteString("abc")\n\tb, err := d.MarshalBinary()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\td = New()\n\td.WriteString("junk")\n\tif err := d.UnmarshalBinary(b); err != nil {\n\t\tt.Fatal(err)\n\t}\n\td.WriteString("def")\n\tif got, want := d.Sum64(), Sum64String("abcdef"); got != want {\n\t\tt.Fatalf("after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x", got, want)\n\t}\n\n\td0 := New()\n\td1 := New()\n\tfor i := 0; i \u003c 64; i++ {\n\t\tb, err := d0.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\td0 = new(Digest)\n\t\tif err := d0.UnmarshalBinary(b); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif got, want := d0.Sum64(), d1.Sum64(); got != want {\n\t\t\tt.Fatalf("after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x", i, got, want)\n\t\t}\n\n\t\td0.Write([]byte{'a'})\n\t\td1.Write([]byte{'a'})\n\t}\n}\n\nfunc TestAllocs(t *testing.T) {\n\tconst shortStr = "abcdefghijklmnop"\n\t// Sum64([]byte(shortString)) shouldn't allocate because the\n\t// intermediate []byte ought not to escape.\n\t// (See https://github.com/cespare/xxhash/pull/2.)\n\tt.Run("Sum64", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64([]byte(shortStr))\n\t\t})\n\t})\n\t// Creating and using a Digest shouldn't allocate because its methods\n\t// shouldn't make it escape. (A previous version of New returned a\n\t// hash.Hash64 which forces an allocation.)\n\tt.Run("Digest", func(t *testing.T) {\n\t\tb := []byte("asdf")\n\t\ttestAllocs(t, func() {\n\t\t\td := New()\n\t\t\td.Write(b)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n\nfunc testAllocs(t *testing.T, fn func()) {\n\tt.Helper()\n\tif allocs := int(testing.AllocsPerRun(10, fn)); allocs \u003e 0 {\n\t\tt.Fatalf("got %d allocation(s) (want zero)", allocs)\n\t}\n}\n\nvar sink uint64\n\nvar benchmarks = []struct {\n\tname         string\n\tdirectBytes  func([]byte) uint64\n\tdirectString func(string) uint64\n\tdigestBytes  func([]byte) uint64\n\tdigestString func(string) uint64\n}{\n\t{\n\t\tname:         "xxhash",\n\t\tdirectBytes:  Sum64,\n\t\tdirectString: Sum64String,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := New()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := New()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:         "OneOfOne",\n\t\tdirectBytes:  OneOfOne.Checksum64,\n\t\tdirectString: OneOfOne.ChecksumString64,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:        "murmur3",\n\t\tdirectBytes: murmur3.Sum64,\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn murmur3.Sum64([]byte(s))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname: "CRC-32",\n\t\tdirectBytes: func(b []byte) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE(b))\n\t\t},\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE([]byte(s)))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write(b)\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write([]byte(s))\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t},\n\t{\n\t\tname: "FNV-1a",\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := fnv.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := fnv.New64a()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n}\n\nfunc BenchmarkHashes(b *testing.B) {\n\tfor _, bb := range benchmarks {\n\t\tfor _, benchSize := range []struct {\n\t\t\tname string\n\t\t\tn    int\n\t\t}{\n\t\t\t{"5B", 5},\n\t\t\t{"100B", 100},\n\t\t\t{"4KB", 4e3},\n\t\t\t{"10MB", 10e6},\n\t\t} {\n\t\t\tinput := make([]byte, benchSize.n)\n\t\t\tfor i := range input {\n\t\t\t\tinput[i] = byte(i)\n\t\t\t}\n\t\t\tinputString := string(input)\n\t\t\tif bb.directBytes != nil {\n\t\t\t\tname := fmt.Sprintf("%s,direct,bytes,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.directBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.directString != nil {\n\t\t\t\tname := fmt.Sprintf("%s,direct,string,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.directString)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestBytes != nil {\n\t\t\t\tname := fmt.Sprintf("%s,digest,bytes,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.digestBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestString != nil {\n\t\t\t\tname := fmt.Sprintf("%s,digest,string,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.digestString)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc benchmarkHashBytes(b *testing.B, input []byte, fn func([]byte) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i \u003c b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n\nfunc benchmarkHashString(b *testing.B, input string, fn func(string) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i \u003c b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n"}}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"103.444668ms for GOROOT= GOPATH=/home/caleb/p/go:/home/caleb GO111MODULE= PWD=/home/caleb/p/xxhash go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/home/caleb/p/xxhash", stderr: \u003c\u003c\u003e\u003e\n"}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"go/packages.Load\n\tpackage = github.com/cespare/xxhash/v2\n\tfiles = [/home/caleb/p/xxhash/xxhash.go /home/caleb/p/xxhash/xxhash_amd64.go /home/caleb/p/xxhash/xxhash_unsafe.go /home/caleb/p/xxhash/xxhash_test.go /home/caleb/p/xxhash/xxhash_unsafe_test.go]"}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"go/packages.Load\n\tpackages = 1"}
[Trace - 3:13:40 PM] Sending notification 'textDocument/didOpen' in 82ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go","languageId":"go","version":0,"text":"// +build !appengine\n\npackage xxhash\n\nimport (\n\t"strings"\n\t"testing"\n)\n\nfunc TestStringAllocs(t *testing.T) {\n\tlongStr := strings.Repeat("a", 1000)\n\tt.Run("Sum64String", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64String(longStr)\n\t\t})\n\t})\n\tt.Run("Digest.WriteString", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\td := New()\n\t\t\td.WriteString(longStr)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n"}}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"111.489841ms for GOROOT= GOPATH=/home/caleb/p/go:/home/caleb GO111MODULE= PWD=/home/caleb/p/xxhash go "list" "-e" "-json" "-compiled=true" "-test=true" "-export=false" "-deps=true" "-find=false" "--" "/home/caleb/p/xxhash", stderr: \u003c\u003c\u003e\u003e\n"}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"go/packages.Load\n\tpackage = github.com/cespare/xxhash/v2\n\tfiles = [/home/caleb/p/xxhash/xxhash.go /home/caleb/p/xxhash/xxhash_amd64.go /home/caleb/p/xxhash/xxhash_unsafe.go /home/caleb/p/xxhash/xxhash_test.go /home/caleb/p/xxhash/xxhash_unsafe_test.go]"}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":3,"message":"go/packages.Load\n\tpackages = 1"}
[Trace - 3:13:40 PM] Sending notification 'textDocument/didChange' in 193ms.
Params: {"textDocument":{"version":1,"uri":"file:///home/caleb/p/xxhash/xxhash.go"},"contentChanges":[{"text":"// Package xxhash implements the 64-bit variant of xxHash (XXH64) as described\n// at http://cyan4973.github.io/xxHash/.\npackage xxhash\n\nimport (\n\t"encoding/binary"\n\t"errors"\n\t"math/bits"\n)\n\nconst (\n\tprime1 uint64 = 11400714785074694791\n\tprime2 uint64 = 14029467366897019727\n\tprime3 uint64 = 1609587929392839161\n\tprime4 uint64 = 9650029242287828579\n\tprime5 uint64 = 2870177450012600261\n)\n\n// NOTE(caleb): I'm using both consts and vars of the primes. Using consts where\n// possible in the Go code is worth a small (but measurable) performance boost\n// by avoiding some MOVQs. Vars are needed for the asm and also are useful for\n// convenience in the Go code in a few places where we need to intentionally\n// avoid constant arithmetic (e.g., v1 := prime1 + prime2 fails because the\n// result overflows a uint64).\nvar (\n\tprime1v = prime1\n\tprime2v = prime2\n\tprime3v = prime3\n\tprime4v = prime4\n\tprime5v = prime5\n)\n\n// Digest implements hash.Hash64.\ntype Digest struct {\n\tv1    uint64\n\tv2    uint64\n\tv3    uint64\n\tv4    uint64\n\ttotal uint64\n\tmem   [32]byte\n\tn     int // how much of mem is used\n}\n\n// NewABC creates a new Digest that computes the 64-bit xxHash algorithm.\nfunc NewABC() *Digest {\n\tvar d Digest\n\td.Reset()\n\treturn \u0026d\n}\n\n// Reset clears the Digest's state so that it can be reused.\nfunc (d *Digest) Reset() {\n\td.v1 = prime1v + prime2\n\td.v2 = prime2\n\td.v3 = 0\n\td.v4 = -prime1v\n\td.total = 0\n\td.n = 0\n}\n\n// Size always returns 8 bytes.\nfunc (d *Digest) Size() int { return 8 }\n\n// BlockSize always returns 32 bytes.\nfunc (d *Digest) BlockSize() int { return 32 }\n\n// Write adds more data to d. It always returns len(b), nil.\nfunc (d *Digest) Write(b []byte) (n int, err error) {\n\tn = len(b)\n\td.total += uint64(n)\n\n\tif d.n+n \u003c 32 {\n\t\t// This new data doesn't even fill the current block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.n += n\n\t\treturn\n\t}\n\n\tif d.n \u003e 0 {\n\t\t// Finish off the partial block.\n\t\tcopy(d.mem[d.n:], b)\n\t\td.v1 = round(d.v1, u64(d.mem[0:8]))\n\t\td.v2 = round(d.v2, u64(d.mem[8:16]))\n\t\td.v3 = round(d.v3, u64(d.mem[16:24]))\n\t\td.v4 = round(d.v4, u64(d.mem[24:32]))\n\t\tb = b[32-d.n:]\n\t\td.n = 0\n\t}\n\n\tif len(b) \u003e= 32 {\n\t\t// One or more full blocks left.\n\t\tnw := writeBlocks(d, b)\n\t\tb = b[nw:]\n\t}\n\n\t// Store any remaining partial block.\n\tcopy(d.mem[:], b)\n\td.n = len(b)\n\n\treturn\n}\n\n// Sum appends the current hash to b and returns the resulting slice.\nfunc (d *Digest) Sum(b []byte) []byte {\n\ts := d.Sum64()\n\treturn append(\n\t\tb,\n\t\tbyte(s\u003e\u003e56),\n\t\tbyte(s\u003e\u003e48),\n\t\tbyte(s\u003e\u003e40),\n\t\tbyte(s\u003e\u003e32),\n\t\tbyte(s\u003e\u003e24),\n\t\tbyte(s\u003e\u003e16),\n\t\tbyte(s\u003e\u003e8),\n\t\tbyte(s),\n\t)\n}\n\n// Sum64 returns the current hash.\nfunc (d *Digest) Sum64() uint64 {\n\tvar h uint64\n\n\tif d.total \u003e= 32 {\n\t\tv1, v2, v3, v4 := d.v1, d.v2, d.v3, d.v4\n\t\th = rol1(v1) + rol7(v2) + rol12(v3) + rol18(v4)\n\t\th = mergeRound(h, v1)\n\t\th = mergeRound(h, v2)\n\t\th = mergeRound(h, v3)\n\t\th = mergeRound(h, v4)\n\t} else {\n\t\th = d.v3 + prime5\n\t}\n\n\th += d.total\n\n\ti, end := 0, d.n\n\tfor ; i+8 \u003c= end; i += 8 {\n\t\tk1 := round(0, u64(d.mem[i:i+8]))\n\t\th ^= k1\n\t\th = rol27(h)*prime1 + prime4\n\t}\n\tif i+4 \u003c= end {\n\t\th ^= uint64(u32(d.mem[i:i+4])) * prime1\n\t\th = rol23(h)*prime2 + prime3\n\t\ti += 4\n\t}\n\tfor i \u003c end {\n\t\th ^= uint64(d.mem[i]) * prime5\n\t\th = rol11(h) * prime1\n\t\ti++\n\t}\n\n\th ^= h \u003e\u003e 33\n\th *= prime2\n\th ^= h \u003e\u003e 29\n\th = prime3\n\th ^= h \u003e\u003e 32\n\n\treturn h\n}\n\nconst (\n\tmagic         = "xxh\x06"\n\tmarshaledSize = len(magic) + 85 + 32\n)\n\n// MarshalBinary implements the encoding.BinaryMarshaler interface.\nfunc (d *Digest) MarshalBinary() ([]byte, error) {\n\tb := make([]byte, 0, marshaledSize)\n\tb = append(b, magic...)\n\tb = appendUint64(b, d.v1)\n\tb = appendUint64(b, d.v2)\n\tb = appendUint64(b, d.v3)\n\tb = appendUint64(b, d.v4)\n\tb = appendUint64(b, d.total)\n\tb = append(b, d.mem[:d.n]...)\n\tb = b[:len(b)+len(d.mem)-d.n]\n\treturn b, nil\n}\n\n// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.\nfunc (d *Digest) UnmarshalBinary(b []byte) error {\n\tif len(b) \u003c len(magic) || string(b[:len(magic)]) != magic {\n\t\treturn errors.New("xxhash: invalid hash state identifier")\n\t}\n\tif len(b) != marshaledSize {\n\t\treturn errors.New("xxhash: invalid hash state size")\n\t}\n\tb = b[len(magic):]\n\tb, d.v1 = consumeUint64(b)\n\tb, d.v2 = consumeUint64(b)\n\tb, d.v3 = consumeUint64(b)\n\tb, d.v4 = consumeUint64(b)\n\tb, d.total = consumeUint64(b)\n\tcopy(d.mem[:], b)\n\tb = b[len(d.mem):]\n\td.n = int(d.total % uint64(len(d.mem)))\n\treturn nil\n}\n\nfunc appendUint64(b []byte, x uint64) []byte {\n\tvar a [8]byte\n\tbinary.LittleEndian.PutUint64(a[:], x)\n\treturn append(b, a[:]...)\n}\n\nfunc consumeUint64(b []byte) ([]byte, uint64) {\n\tx := u64(b)\n\treturn b[8:], x\n}\n\nfunc u64(b []byte) uint64 { return binary.LittleEndian.Uint64(b) }\nfunc u32(b []byte) uint32 { return binary.LittleEndian.Uint32(b) }\n\nfunc round(acc, input uint64) uint64 {\n\tacc += input * prime2\n\tacc = rol31(acc)\n\tacc = prime1\n\treturn acc\n}\n\nfunc mergeRound(acc, val uint64) uint64 {\n\tval = round(0, val)\n\tacc ^= val\n\tacc = accprime1 + prime4\n\treturn acc\n}\n\nfunc rol1(x uint64) uint64  { return bits.RotateLeft64(x, 1) }\nfunc rol7(x uint64) uint64  { return bits.RotateLeft64(x, 7) }\nfunc rol11(x uint64) uint64 { return bits.RotateLeft64(x, 11) }\nfunc rol12(x uint64) uint64 { return bits.RotateLeft64(x, 12) }\nfunc rol18(x uint64) uint64 { return bits.RotateLeft64(x, 18) }\nfunc rol23(x uint64) uint64 { return bits.RotateLeft64(x, 23) }\nfunc rol27(x uint64) uint64 { return bits.RotateLeft64(x, 27) }\nfunc rol31(x uint64) uint64 { return bits.RotateLeft64(x, 31) }\n"}]}
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":1,"message":"unable to check package: context canceled\n\tfile = file:///home/caleb/p/xxhash/xxhash_test.go"}
[Trace - 3:13:40 PM] Sending notification 'textDocument/didChange' in 194ms.
Params: {"textDocument":{"version":1,"uri":"file:///home/caleb/p/xxhash/xxhash_test.go"},"contentChanges":[{"text":"package xxhash\n\nimport (\n\t"bytes"\n\t"encoding/binary"\n\t"fmt"\n\t"hash/crc32"\n\t"hash/fnv"\n\t"strings"\n\t"testing"\n\n\tOneOfOne "github.com/OneOfOne/xxhash"\n\t"github.com/spaolacci/murmur3"\n)\n\nfunc TestAll(t *testing.T) {\n\tfor _, tt := range []struct {\n\t\tname  string\n\t\tinput string\n\t\twant  uint64\n\t}{\n\t\t{"empty", "", 0xef46db3751d8e999},\n\t\t{"a", "a", 0xd24ec4f1a98c6e5b},\n\t\t{"as", "as", 0x1c330fb2d66be179},\n\t\t{"asd", "asd", 0x631c37ce72a97393},\n\t\t{"asdf", "asdf", 0x415872f599cea71e},\n\t\t{\n\t\t\t"len=63",\n\t\t\t// Exactly 63 characters, which exercises all code paths.\n\t\t\t"Call me Ishmael. Some years ago--never mind how long precisely-",\n\t\t\t0x02a2e85470d6fd96,\n\t\t},\n\t} {\n\t\tfor chunkSize := 1; chunkSize \u003c= len(tt.input); chunkSize++ {\n\t\t\tname := fmt.Sprintf("%s,chunkSize=%d", tt.name, chunkSize)\n\t\t\tt.Run(name, func(t *testing.T) {\n\t\t\t\ttestDigest(t, tt.input, chunkSize, tt.want)\n\t\t\t})\n\t\t}\n\t\tt.Run(tt.name, func(t *testing.T) { testSum(t, tt.input, tt.want) })\n\t}\n}\n\nfunc testDigest(t *testing.T, input string, chunkSize int, want uint64) {\n\td := NewABC()\n\tds := NewABC() // uses WriteString\n\tfor i := 0; i \u003c len(input); i += chunkSize {\n\t\tchunk := input[i:]\n\t\tif len(chunk) \u003e chunkSize {\n\t\t\tchunk = chunk[:chunkSize]\n\t\t}\n\t\tn, err := d.Write([]byte(chunk))\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf("Digest.Write: got (%d, %v); want (%d, nil)", n, err, len(chunk))\n\t\t}\n\t\tn, err = ds.WriteString(chunk)\n\t\tif err != nil || n != len(chunk) {\n\t\t\tt.Fatalf("Digest.WriteString: got (%d, %v); want (%d, nil)", n, err, len(chunk))\n\t\t}\n\t}\n\tif got := d.Sum64(); got != want {\n\t\tt.Fatalf("Digest.Sum64: got 0x%x; want 0x%x", got, want)\n\t}\n\tif got := ds.Sum64(); got != want {\n\t\tt.Fatalf("Digest.Sum64 (WriteString): got 0x%x; want 0x%x", got, want)\n\t}\n\tvar b [8]byte\n\tbinary.BigEndian.PutUint64(b[:], want)\n\tif got := d.Sum(nil); !bytes.Equal(got, b[:]) {\n\t\tt.Fatalf("Sum: got %v; want %v", got, b[:])\n\t}\n}\n\nfunc testSum(t *testing.T, input string, want uint64) {\n\tif got := Sum64([]byte(input)); got != want {\n\t\tt.Fatalf("Sum64: got 0x%x; want 0x%x", got, want)\n\t}\n\tif got := Sum64String(input); got != want {\n\t\tt.Fatalf("Sum64String: got 0x%x; want 0x%x", got, want)\n\t}\n}\n\nfunc TestReset(t *testing.T) {\n\tparts := []string{"The quic", "k br", "o", "wn fox jumps", " ov", "er the lazy ", "dog."}\n\td := NewABC()\n\tfor _, part := range parts {\n\t\td.Write([]byte(part))\n\t}\n\th0 := d.Sum64()\n\n\td.Reset()\n\td.Write([]byte(strings.Join(parts, "")))\n\th1 := d.Sum64()\n\n\tif h0 != h1 {\n\t\tt.Errorf("0x%x != 0x%x", h0, h1)\n\t}\n}\n\nfunc TestBinaryMarshaling(t *testing.T) {\n\td := NewABC()\n\td.WriteString("abc")\n\tb, err := d.MarshalBinary()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\td = NewABC()\n\td.WriteString("junk")\n\tif err := d.UnmarshalBinary(b); err != nil {\n\t\tt.Fatal(err)\n\t}\n\td.WriteString("def")\n\tif got, want := d.Sum64(), Sum64String("abcdef"); got != want {\n\t\tt.Fatalf("after MarshalBinary+UnmarshalBinary, got 0x%x; want 0x%x", got, want)\n\t}\n\n\td0 := NewABC()\n\td1 := NewABC()\n\tfor i := 0; i \u003c 64; i++ {\n\t\tb, err := d0.MarshalBinary()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\td0 = new(Digest)\n\t\tif err := d0.UnmarshalBinary(b); err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif got, want := d0.Sum64(), d1.Sum64(); got != want {\n\t\t\tt.Fatalf("after %d Writes, unmarshaled Digest gave sum 0x%x; want 0x%x", i, got, want)\n\t\t}\n\n\t\td0.Write([]byte{'a'})\n\t\td1.Write([]byte{'a'})\n\t}\n}\n\nfunc TestAllocs(t *testing.T) {\n\tconst shortStr = "abcdefghijklmnop"\n\t// Sum64([]byte(shortString)) shouldn't allocate because the\n\t// intermediate []byte ought not to escape.\n\t// (See https://github.com/cespare/xxhash/pull/2.)\n\tt.Run("Sum64", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64([]byte(shortStr))\n\t\t})\n\t})\n\t// Creating and using a Digest shouldn't allocate because its methods\n\t// shouldn't make it escape. (A previous version of New returned a\n\t// hash.Hash64 which forces an allocation.)\n\tt.Run("Digest", func(t *testing.T) {\n\t\tb := []byte("asdf")\n\t\ttestAllocs(t, func() {\n\t\t\td := NewABC()\n\t\t\td.Write(b)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n\nfunc testAllocs(t *testing.T, fn func()) {\n\tt.Helper()\n\tif allocs := int(testing.AllocsPerRun(10, fn)); allocs \u003e 0 {\n\t\tt.Fatalf("got %d allocation(s) (want zero)", allocs)\n\t}\n}\n\nvar sink uint64\n\nvar benchmarks = []struct {\n\tname         string\n\tdirectBytes  func([]byte) uint64\n\tdirectString func(string) uint64\n\tdigestBytes  func([]byte) uint64\n\tdigestString func(string) uint64\n}{\n\t{\n\t\tname:         "xxhash",\n\t\tdirectBytes:  Sum64,\n\t\tdirectString: Sum64String,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := NewABC()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := NewABC()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:         "OneOfOne",\n\t\tdirectBytes:  OneOfOne.Checksum64,\n\t\tdirectString: OneOfOne.ChecksumString64,\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := OneOfOne.New64()\n\t\t\th.WriteString(s)\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname:        "murmur3",\n\t\tdirectBytes: murmur3.Sum64,\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn murmur3.Sum64([]byte(s))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := murmur3.New64()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n\t{\n\t\tname: "CRC-32",\n\t\tdirectBytes: func(b []byte) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE(b))\n\t\t},\n\t\tdirectString: func(s string) uint64 {\n\t\t\treturn uint64(crc32.ChecksumIEEE([]byte(s)))\n\t\t},\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write(b)\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := crc32.NewIEEE()\n\t\t\th.Write([]byte(s))\n\t\t\treturn uint64(h.Sum32())\n\t\t},\n\t},\n\t{\n\t\tname: "FNV-1a",\n\t\tdigestBytes: func(b []byte) uint64 {\n\t\t\th := fnv.New64()\n\t\t\th.Write(b)\n\t\t\treturn h.Sum64()\n\t\t},\n\t\tdigestString: func(s string) uint64 {\n\t\t\th := fnv.New64a()\n\t\t\th.Write([]byte(s))\n\t\t\treturn h.Sum64()\n\t\t},\n\t},\n}\n\nfunc BenchmarkHashes(b *testing.B) {\n\tfor _, bb := range benchmarks {\n\t\tfor _, benchSize := range []struct {\n\t\t\tname string\n\t\t\tn    int\n\t\t}{\n\t\t\t{"5B", 5},\n\t\t\t{"100B", 100},\n\t\t\t{"4KB", 4e3},\n\t\t\t{"10MB", 10e6},\n\t\t} {\n\t\t\tinput := make([]byte, benchSize.n)\n\t\t\tfor i := range input {\n\t\t\t\tinput[i] = byte(i)\n\t\t\t}\n\t\t\tinputString := string(input)\n\t\t\tif bb.directBytes != nil {\n\t\t\t\tname := fmt.Sprintf("%s,direct,bytes,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.directBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.directString != nil {\n\t\t\t\tname := fmt.Sprintf("%s,direct,string,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.directString)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestBytes != nil {\n\t\t\t\tname := fmt.Sprintf("%s,digest,bytes,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashBytes(b, input, bb.digestBytes)\n\t\t\t\t})\n\t\t\t}\n\t\t\tif bb.digestString != nil {\n\t\t\t\tname := fmt.Sprintf("%s,digest,string,n=%s", bb.name, benchSize.name)\n\t\t\t\tb.Run(name, func(b *testing.B) {\n\t\t\t\t\tbenchmarkHashString(b, inputString, bb.digestString)\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc benchmarkHashBytes(b *testing.B, input []byte, fn func([]byte) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i \u003c b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n\nfunc benchmarkHashString(b *testing.B, input string, fn func(string) uint64) {\n\tb.SetBytes(int64(len(input)))\n\tfor i := 0; i \u003c b.N; i++ {\n\t\tsink = fn(input)\n\t}\n}\n"}]}
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Trace - 3:13:40 PM] Sending notification 'textDocument/didChange' in 192ms.
Params: {"textDocument":{"version":1,"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go"},"contentChanges":[{"text":"// +build !appengine\n\npackage xxhash\n\nimport (\n\t"strings"\n\t"testing"\n)\n\nfunc TestStringAllocs(t *testing.T) {\n\tlongStr := strings.Repeat("a", 1000)\n\tt.Run("Sum64String", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\tsink = Sum64String(longStr)\n\t\t})\n\t})\n\tt.Run("Digest.WriteString", func(t *testing.T) {\n\t\ttestAllocs(t, func() {\n\t\t\td := NewABC()\n\t\t\td.WriteString(longStr)\n\t\t\tsink = d.Sum64()\n\t\t})\n\t})\n}\n"}]}
[Trace - 3:13:40 PM] Received notification 'window/logMessage' in 0ms.
Params: {"type":1,"message":"unable to check package: context canceled\n\tfile = file:///home/caleb/p/xxhash/xxhash_unsafe_test.go"}
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Error - 3:13:40 PM] send textDocument/publishDiagnostics context canceled
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_amd64.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_test.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_amd64.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe.go","diagnostics":[]}
[Trace - 3:13:40 PM] Received notification 'textDocument/publishDiagnostics' in 0ms.
Params: {"uri":"file:///home/caleb/p/xxhash/xxhash_test.go","diagnostics":[]}
[Trace - 3:13:42 PM] Received response 'textDocument/codeAction - (3)' in 0ms.
Params: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"changes":{"file:///home/caleb/p/xxhash/xxhash.go":[]}}}]
[Trace - 3:13:42 PM] Sending notification 'textDocument/codeAction' in 17ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":null}}
[Trace - 3:13:42 PM] Received response 'textDocument/codeAction - (4)' in 0ms.
Params: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"changes":{"file:///home/caleb/p/xxhash/xxhash_test.go":[]}}}]
[Trace - 3:13:42 PM] Sending notification 'textDocument/codeAction' in 10ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash_test.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":null}}
[Trace - 3:13:42 PM] Received response 'textDocument/codeAction - (5)' in 0ms.
Params: [{"title":"Organize Imports","kind":"source.organizeImports","edit":{"changes":{"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go":[]}}}]
[Trace - 3:13:42 PM] Sending notification 'textDocument/codeAction' in 1ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash_unsafe_test.go"},"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"context":{"diagnostics":null}}
[Trace - 3:13:47 PM] Received response 'textDocument/rename - (6)' in 0ms.
Params: {}
[Trace - 3:13:47 PM] Sending notification 'textDocument/rename' in 0ms.
Params: {"textDocument":{"uri":"file:///home/caleb/p/xxhash/xxhash.go"},"position":{"line":44,"character":6},"newName":"NewXYZ"}

How did you install govim?
Vim 8 packages
What did you do?
I can repro this in just about any code. But to have a concrete case for discussion, I edited this line in github.com/cespare/xxhash.

Put the cursor over the function name New.
GOVIMRename to change New to NewABC.
2 other splits open (#459).
:wa to commit these changes to disk.
With the cursor still over the function name (NewABC), GOVIMRename again from NewABC to NewXYZ.

What did you expect to see?
The second rename works fine.
What did you see instead?
Sometimes this succeeds. But most of the time it fails with the following message:
E605: Exception not caught: got error whilst handling command:GOVIMRename: called to gopls.Rename failed: no object for ident NewABC

In the cases where it succeeds, doing another rename usually fails.
I'm not sure if this is a govim bug or a gopls one.

I checked and the error still repros with latest gopls (golang.org/x/tools/gopls v0.1.4-0.20190819174341-15fda70baffd).

Thanks for the report and the repro. Will help out investigating.

authors: cespare myitcv

repo: myitcv/govim