Skip to content

Commit

Permalink
remove gopkg.in from README.
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed Apr 7, 2016
1 parent 4c73e74 commit 1cc575d
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ This is a port of psutil (http://pythonhosted.org/psutil/). The challenge is por
psutil functions on some architectures...


.. highlights:: Breaking Changes will comes!
.. highlights:: Breaking Changes!

We introduced versioning by using gopkgin. And breaking changes will be introduced at v2. See `issue 174 <https://github.com/shirou/gopsutil/issues/174>`_ .
Breaking changes is introduced at v2. See `issue 174 <https://github.com/shirou/gopsutil/issues/174>`_ .


Migrating to v2
Expand All @@ -39,32 +39,34 @@ All works are implemented without cgo by porting c struct to golang struct.
Usage
---------

Note: gopsutil.v2 breaks compatibility. If you want to stay with compatibility, please use `gopkg.in/shirou/gopsutil.v1`.
Note: gopsutil v2 breaks compatibility. If you want to stay with compatibility, please use v1 branch and vendoring.

.. code:: go
package main
import (
"fmt"
"fmt"
mem "gopkg.in/shirou/gopsutil.v2/mem"
"github.com/shirou/gopsutil/mem"
)
func main() {
v, _ := mem.VirtualMemory()
v, _ := mem.VirtualMemory()
// almost every return value is a struct
fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent)
// almost every return value is a struct
fmt.Printf("Total: %v, Free:%v, UsedPercent:%f%%\n", v.Total, v.Free, v.UsedPercent)
// convert to JSON. String() is also implemented
fmt.Println(v)
// convert to JSON. String() is also implemented
fmt.Println(v)
}
The output is below.

::

Total: 3179569152, Free:284233728, UsedPercent:84.508194%
{"total":3179569152,"available":492572672,"used":2895335424,"usedPercent":84.50819439828305, (snip)}
{"total":3179569152,"available":492572672,"used":2895335424,"usedPercent":84.50819439828305, (snip...)}

You can set an alternative location to /proc by setting the HOST_PROC environment variable.
You can set an alternative location to /sys by setting the HOST_SYS environment variable.
Expand Down

0 comments on commit 1cc575d

Please sign in to comment.