Skip to content

Commit

Permalink
lxd/instance/file: Add pattern matching for stat.Sys().(*sftp.FileSta…
Browse files Browse the repository at this point in the history
…t) type assertion

Signed-off-by: Kadin Sayani <[email protected]>
  • Loading branch information
kadinsayani authored and tomponline committed Sep 13, 2024
1 parent ed8917f commit bfd326e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lxd/instance_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func instanceFileGet(s *state.State, inst instance.Instance, path string, r *htt
fileType = "symlink"
}

fs := stat.Sys().(*sftp.FileStat)
fs, _ := stat.Sys().(*sftp.FileStat)

// Prepare the response.
headers := map[string]string{
Expand Down Expand Up @@ -339,7 +339,7 @@ func instanceFileHead(inst instance.Instance, path string) response.Response {
fileType = "symlink"
}

fs := stat.Sys().(*sftp.FileStat)
fs, _ := stat.Sys().(*sftp.FileStat)

// Prepare the response.
headers := map[string]string{
Expand Down

0 comments on commit bfd326e

Please sign in to comment.