Skip to content

Commit

Permalink
proc: replace os.SEEK_CUR with io.SeekCurrent (go-delve#3214)
Browse files Browse the repository at this point in the history
Because os.SEEK_CUR is deprecated as stated in the documentation.
  • Loading branch information
alexandear authored Dec 12, 2022
1 parent 3a91d56 commit 34b6ee8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/proc/core/linux_core.go
Original file line number Diff line number Diff line change
Expand Up @@ -340,14 +340,14 @@ func readNote(r io.ReadSeeker, machineType elf.Machine) (*note, error) {

// skipPadding moves r to the next multiple of pad.
func skipPadding(r io.ReadSeeker, pad int64) error {
pos, err := r.Seek(0, os.SEEK_CUR)
pos, err := r.Seek(0, io.SeekCurrent)
if err != nil {
return err
}
if pos%pad == 0 {
return nil
}
if _, err := r.Seek(pad-(pos%pad), os.SEEK_CUR); err != nil {
if _, err := r.Seek(pad-(pos%pad), io.SeekCurrent); err != nil {
return err
}
return nil
Expand Down
2 changes: 1 addition & 1 deletion pkg/proc/variables.go
Original file line number Diff line number Diff line change
Expand Up @@ -2293,7 +2293,7 @@ func (v *Variable) ConstDescr() string {
}
if typename := v.DwarfType.Common().Name; !strings.Contains(typename, ".") || strings.HasPrefix(typename, "C.") {
// only attempt to use constants for user defined type, otherwise every
// int variable with value 1 will be described with os.SEEK_CUR and other
// int variable with value 1 will be described with io.SeekCurrent and other
// similar problems.
return ""
}
Expand Down

0 comments on commit 34b6ee8

Please sign in to comment.