| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Please let me know if you need my review for these, otherwise I will let Hongxiang review.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
internal/server: trigger vulncheck prompt for go.mod changesgopls/internal/server
// computeGoModHash computes the SHA256 hash of the go.mod file's dependencies.Let's mention the irrelevant file content is ignored. Only the important part related to dependency is considered when computing the hash.
func computeGoModHash(modFile *modfile.File) (string, error) {`file`. the type is clear enough.
// showMessageRequest causes the client to show a prompt that the user can respond to.There is another references in `gopls/internal/server/prompt.go` should we consolidate them? Like calling this function in `gopls/internal/server/prompt.go`?
func (s *server) checkGoModDeps(ctx context.Context, change protocol.FileEvent, params *protocol.DidChangeWatchedFilesParams) {What is the purpose of this `params` input? AFAIK, this parameter contains a list of protocol.FileEvent, I thought we only care about the one that is relevant to the go.mod file.
Let me know what you think.
newContent, err := os.ReadFile(change.URI.Path())This bring me another question, the vulncheck is executed based on the file written in disk, have we considered the case where the file is modified in buffer and have not written to disk?
newContent, err := os.ReadFile(change.URI.Path())Nit: we can re-organize the code to make cleaner, this allow us to focusing on the important part of the code. (Those variables that need to be calculated)
```
var newHash, oldHash ...
{
// this block of code is to compute the new hash and old hash
}if newHas != oldHash {
...
}
```| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |