1
0
mirror of https://github.com/google/gops.git synced 2024-11-19 20:31:58 +02:00

add license

This commit is contained in:
Jaana Burcu Dogan 2016-11-03 16:56:19 -07:00
parent 6d6995e5c3
commit d6d1ca2206
2 changed files with 37 additions and 1 deletions

27
LICENSE Normal file
View File

@ -0,0 +1,27 @@
Copyright (c) 2016 The Go Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

11
gops.go
View File

@ -1,3 +1,8 @@
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Program gops is a tool to list currently running Go processes.
package main
import (
@ -25,7 +30,6 @@ func main() {
ok, err := isGo(name)
if err != nil {
undetermined++
continue
}
@ -33,6 +37,10 @@ func main() {
fmt.Printf("%d\t%v\n", pr.Pid(), pr.Executable())
}
}
if undetermined > 0 {
fmt.Printf("\n%d processes\n", undetermined)
}
}
func isGo(filename string) (ok bool, err error) {
@ -48,6 +56,7 @@ func isGo(filename string) (ok bool, err error) {
}
// TODO(jbd): find a faster way to determine Go programs
// looping over the symbols is a joke.
for _, s := range symbols {
if s.Name == "runtime.buildVersion" {
return true, nil