Skip to content

Commit

Permalink
Ignore unsafe pointer conversion warning
Browse files Browse the repository at this point in the history
This is a temporary fix for elastic#138
to ignore the warning.
  • Loading branch information
andrewkroh committed Jul 14, 2020
1 parent 68c4b9e commit c111bcf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ build_script:
test_script:
# Unit tests
- ps: Add-AppveyorTest "Unit Tests" -Outcome Running
- go test -v ./...
- go test -gcflags=-d=checkptr -v ./...
- ps: Update-AppveyorTest "Unit Tests" -Outcome Passed
- ps: Add-AppveyorTest "Running Examples" -Outcome Running
- .\examples\df\df.exe
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ script:
- gofmt -l . | read && echo "Code differs from gofmt's style. Run 'gofmt -w .'" 1>&2 && exit 1 || true
- go vet
- go build
- go test -v ./...
- go test -gcflags=-d=checkptr -v ./...
- for i in $(ls examples); do go build -o examples/$i/$i ./examples/$i; ./examples/$i/$i; done
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ This project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

Fixed the `ss` example by replacing the Logrus package with the stdlib `log` package. https://github.com/elastic/gosigar/issues/123 https://github.com/elastic/gosigar/pull/136
- Fixed the `ss` example by replacing the Logrus package with the stdlib `log` package. https://github.com/elastic/gosigar/issues/123 https://github.com/elastic/gosigar/pull/136

### Changed

- Ignore unsafe pointer conversion warning. https://github.com/elastic/gosigar/issues/138

### Deprecated

## [0.10.5]
Expand Down
2 changes: 2 additions & 0 deletions sigar_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"unsafe"
)

// TODO (2020-07-14): Fix the unsafe pointer conversion. https://github.com/elastic/gosigar/issues/138
//go:nocheckptr
func bytePtrToString(ptr *int8) string {
bytes := (*[10000]byte)(unsafe.Pointer(ptr))

Expand Down

0 comments on commit c111bcf

Please sign in to comment.