go/gopls/internal
Alan Donovan 2af106efed gopls/internal/hooks: fixes to diff disaster logic
Previously, the disaster logic in the new diff implementation
would "encrypt" the before/after files using a monoalphabetic
substitution, which has been insecure since the 9th century.
Instead, save plain text, in file with mode 0600, and invite
the user to audit the file before sharing it with us.

Also, separate the two files using a NUL byte, not a newline,
which is highly ambiguous.

Also, in the JSON diff stats writer:
- print a warning if we can't create the log file.
  (The previous code was subtle--it stored a nil *os.File in
  an io.Writer, which caused Writes to fail with an error,
  in effect, silently.)
- Don't hold the mutex around the write operation.
- Fix minor off-by-one error (re: 15)
- Crash if JSON encoding fails; it "can't happen".

Change-Id: I9b6a4145451afd77594f0ef9868143634a9c4561
Reviewed-on: https://go-review.googlesource.com/c/tools/+/445580
Run-TryBot: Alan Donovan <adonovan@google.com>
Reviewed-by: Robert Findley <rfindley@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
2022-10-27 00:23:26 +00:00
..
coverage gopls: migrate internal/lsp to gopls/internal/lsp 2022-09-07 16:44:44 +00:00
govulncheck gopls/internal/lsp: use the golang.org/x/vuln/exp/govulncheck 2022-10-11 21:42:28 +00:00
hooks gopls/internal/hooks: fixes to diff disaster logic 2022-10-27 00:23:26 +00:00
lsp tools/gopls: argument in function bodies marked as parameter by semantic tokens 2022-10-26 15:27:38 +00:00
regtest gopls/internal/lsp/mod: merge vuln diagnostics to one, and add a hover 2022-10-25 17:27:10 +00:00
robustio internal/robustio: fix log.Fatal calls that should be log.Fatalf 2022-10-10 21:31:25 +00:00
span gopls/internal/lsp: tolerate missing end position in RelatedInformation 2022-10-19 18:04:39 +00:00
vulncheck gopls/internal/lsp: use the golang.org/x/vuln/exp/govulncheck 2022-10-11 21:42:28 +00:00
migrate.sh gopls/internal/migrate.sh: a script to migrate internal/lsp to gopls/ 2022-09-07 14:10:36 +00:00