Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code should pass go vet, errcheck, golint #88

Closed
bufdev opened this issue Dec 16, 2015 · 2 comments
Closed

Code should pass go vet, errcheck, golint #88

bufdev opened this issue Dec 16, 2015 · 2 comments

Comments

@bufdev
Copy link
Contributor

bufdev commented Dec 16, 2015

This is a major cleanup we'll do later, I also think I will propose a general style guide.

@bufdev
Copy link
Contributor Author

bufdev commented Dec 21, 2015

$ make errcheck
go get -v github.com/kisielk/errcheck
errcheck -tags "daemon btrfs_noversion have_btrfs" github.com/libopenstorage/openstorage/api github.com/libopenstorage/openstorage/api/client github.com/libopenstorage/openstorage/api/server github.com/libopenstorage/openstorage/cli github.com/libopenstorage/openstorage/cluster github.com/libopenstorage/openstorage/cmd/osd github.com/libopenstorage/openstorage/config github.com/libopenstorage/openstorage/graph github.com/libopenstorage/openstorage/graph/drivers github.com/libopenstorage/openstorage/graph/drivers/layer0 github.com/libopenstorage/openstorage/graph/drivers/proxy github.com/libopenstorage/openstorage/graph/drivers/unionfs github.com/libopenstorage/openstorage/pkg/chaos github.com/libopenstorage/openstorage/pkg/device github.com/libopenstorage/openstorage/pkg/mount github.com/libopenstorage/openstorage/pkg/seed github.com/libopenstorage/openstorage/pkg/stats github.com/libopenstorage/openstorage/volume github.com/libopenstorage/openstorage/volume/drivers github.com/libopenstorage/openstorage/volume/drivers/aws github.com/libopenstorage/openstorage/volume/drivers/btrfs github.com/libopenstorage/openstorage/volume/drivers/buse github.com/libopenstorage/openstorage/volume/drivers/fuse github.com/libopenstorage/openstorage/volume/drivers/nfs github.com/libopenstorage/openstorage/volume/drivers/pwx github.com/libopenstorage/openstorage/volume/drivers/test github.com/libopenstorage/openstorage/volume/drivers/vfs
github.com/libopenstorage/openstorage/api/client/client_test.go:42:23   server.StartServerAPI(nfs.Name, 9003, config.DriverAPIBase)
github.com/libopenstorage/openstorage/api/client/request.go:267:24  defer resp.Body.Close()
github.com/libopenstorage/openstorage/api/client/volume.go:93:71    v.c.Get().Resource(graphPath + "/exists").Instance(id).Do().Unmarshal(&resp)
github.com/libopenstorage/openstorage/api/server/cluster.go:41:27   json.NewEncoder(w).Encode(cluster)
github.com/libopenstorage/openstorage/api/server/docker.go:85:27    json.NewEncoder(w).Encode(&volumeResponse{})
github.com/libopenstorage/openstorage/api/server/docker.go:128:16   io.WriteString(w, fmt.Sprintln("osd plugin", d.version))
github.com/libopenstorage/openstorage/api/server/docker.go:174:29   json.NewEncoder(w).Encode(&volumeResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:180:29   json.NewEncoder(w).Encode(&volumeResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:185:27   json.NewEncoder(w).Encode(&volumeResponse{})
github.com/libopenstorage/openstorage/api/server/docker.go:202:28   json.NewEncoder(w).Encode(&volumeResponse{Err: e})
github.com/libopenstorage/openstorage/api/server/docker.go:206:27   json.NewEncoder(w).Encode(&volumeResponse{})
github.com/libopenstorage/openstorage/api/server/docker.go:216:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:222:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:230:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:239:29   json.NewEncoder(w).Encode(&volumePathResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:247:13   os.MkdirAll(response.Mountpoint, 0755)
github.com/libopenstorage/openstorage/api/server/docker.go:253:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:257:13   os.MkdirAll(response.Mountpoint, 0755)
github.com/libopenstorage/openstorage/api/server/docker.go:260:27   json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/docker.go:275:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: e})
github.com/libopenstorage/openstorage/api/server/docker.go:283:28   json.NewEncoder(w).Encode(&volumePathResponse{Err: e})
github.com/libopenstorage/openstorage/api/server/docker.go:288:27   json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/docker.go:297:28   json.NewEncoder(w).Encode(&volumeResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/docker.go:311:28   json.NewEncoder(w).Encode(&volumeResponse{Err: e})
github.com/libopenstorage/openstorage/api/server/docker.go:320:28   json.NewEncoder(w).Encode(&volumeResponse{Err: err})
github.com/libopenstorage/openstorage/api/server/graphdriver.go:75:27   json.NewEncoder(w).Encode(&graphResponse{})
github.com/libopenstorage/openstorage/api/server/graphdriver.go:192:27  json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/graphdriver.go:227:27  json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/graphdriver.go:233:27  json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/graphdriver.go:253:27  json.NewEncoder(w).Encode(&response)
github.com/libopenstorage/openstorage/api/server/graphdriver.go:287:9   io.Copy(w, archive)
github.com/libopenstorage/openstorage/api/server/graphdriver.go:306:27  json.NewEncoder(w).Encode(&graphResponse{Changes: changes})
github.com/libopenstorage/openstorage/api/server/graphdriver.go:324:27  json.NewEncoder(w).Encode(&graphResponse{Size: size})
github.com/libopenstorage/openstorage/api/server/graphdriver.go:343:27  json.NewEncoder(w).Encode(&graphResponse{Size: size})
github.com/libopenstorage/openstorage/api/server/server.go:63:11    os.Remove(socket)
github.com/libopenstorage/openstorage/api/server/server.go:64:13    os.MkdirAll(path.Dir(socket), 0755)
github.com/libopenstorage/openstorage/api/server/server.go:72:15    go http.Serve(listener, router)
github.com/libopenstorage/openstorage/api/server/server.go:74:25    go http.ListenAndServe(fmt.Sprintf(":%v", port), router)
github.com/libopenstorage/openstorage/api/server/volume.go:66:27    json.NewEncoder(w).Encode(&dcRes)
github.com/libopenstorage/openstorage/api/server/volume.go:142:27   json.NewEncoder(w).Encode(resp)
github.com/libopenstorage/openstorage/api/server/volume.go:170:27   json.NewEncoder(w).Encode(dk)
github.com/libopenstorage/openstorage/api/server/volume.go:194:27   json.NewEncoder(w).Encode(res)
github.com/libopenstorage/openstorage/api/server/volume.go:244:27   json.NewEncoder(w).Encode(vols)
github.com/libopenstorage/openstorage/api/server/volume.go:267:27   json.NewEncoder(w).Encode(&snapRes)
github.com/libopenstorage/openstorage/api/server/volume.go:305:27   json.NewEncoder(w).Encode(snaps)
github.com/libopenstorage/openstorage/api/server/volume.go:333:27   json.NewEncoder(w).Encode(stats)
github.com/libopenstorage/openstorage/api/server/volume.go:359:27   json.NewEncoder(w).Encode(alerts)
github.com/libopenstorage/openstorage/cli/cluster.go:68:10  w.Flush()
github.com/libopenstorage/openstorage/cli/cluster.go:99:10  w.Flush()
github.com/libopenstorage/openstorage/cluster/manager.go:128:19 defer kvdb.Unlock(kvlock)
github.com/libopenstorage/openstorage/cluster/manager.go:199:16 c.g.AddNode(n.Ip+":9002", types.NodeId(c.config.NodeId))
github.com/libopenstorage/openstorage/cluster/manager.go:379:15 kvdb.Unlock(kvlock)
github.com/libopenstorage/openstorage/cluster/manager.go:403:15 kvdb.Unlock(kvlock)
github.com/libopenstorage/openstorage/cluster/manager.go:417:14 kvdb.Unlock(kvlock)
github.com/libopenstorage/openstorage/cmd/osd/main.go:219:9 app.Run(os.Args)
github.com/libopenstorage/openstorage/config/config.go:54:13    os.MkdirAll(MountBase, 0755)
github.com/libopenstorage/openstorage/config/config.go:55:13    os.MkdirAll(GraphDriverAPIBase, 0755)
github.com/libopenstorage/openstorage/graph/drivers/layer0/layer0.go:63:16  graph.Register(Name, Init)
github.com/libopenstorage/openstorage/graph/drivers/layer0/layer0.go:180:13 os.MkdirAll(mountPath, 0755)
github.com/libopenstorage/openstorage/graph/drivers/layer0/layer0.go:222:14 os.RemoveAll(upperDir)
github.com/libopenstorage/openstorage/graph/drivers/layer0/layer0.go:244:19 l.Driver.Remove(l.realID(id))
github.com/libopenstorage/openstorage/graph/drivers/proxy/proxy.go:15:16    graph.Register("proxy", overlay.Init)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:25:17 syscall.Unmount(dest, 0)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:26:14 os.RemoveAll(dest)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:27:14 os.RemoveAll(source)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:28:13 os.MkdirAll(source, 0755)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:29:13 os.MkdirAll(dest, 0755)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:64:14 os.RemoveAll(dest)
github.com/libopenstorage/openstorage/pkg/mount/mount_test.go:65:14 os.RemoveAll(source)
github.com/libopenstorage/openstorage/pkg/seed/git_test.go:26:14    os.RemoveAll(dest)
github.com/libopenstorage/openstorage/pkg/seed/git_test.go:27:13    os.MkdirAll(dest, 0755)
github.com/libopenstorage/openstorage/pkg/stats/disk.go:68:18   defer file.Close()
github.com/libopenstorage/openstorage/volume/drivers/aws/aws.go:172:22  defer res.Body.Close()
github.com/libopenstorage/openstorage/volume/drivers/aws/aws.go:480:11  chaos.Now(koStrayCreate)
github.com/libopenstorage/openstorage/volume/drivers/aws/aws.go:486:11  chaos.Now(koStrayCreate)
github.com/libopenstorage/openstorage/volume/drivers/aws/aws.go:610:17  volume.Register(Name, Init)
github.com/libopenstorage/openstorage/volume/drivers/btrfs/btrfs.go:119:11  chaos.Now(koStrayDelete)
github.com/libopenstorage/openstorage/volume/drivers/btrfs/btrfs.go:196:11  chaos.Now(koStrayCreate)
github.com/libopenstorage/openstorage/volume/drivers/btrfs/btrfs.go:219:17  volume.Register(Name, Init)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:56:24 defer sourcefile.Close()
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:63:22 defer destfile.Close()
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:97:19 inst.UpdateVol(&info)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:109:21    c.AddEventListener(inst)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:220:11    os.Remove(bd.file)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:221:12    bd.f.Close()
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:288:11    d.Delete(newVolumeID)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:330:17    syscall.Unmount(BuseMountPath, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/buse.go:364:17    volume.Register(Name, Init)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:146:9  ioctl(nbd.deviceFile.Fd(), BLKROSET, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:172:8  ioctl(nbd.deviceFile.Fd(), NBD_DISCONNECT, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:173:8  ioctl(nbd.deviceFile.Fd(), NBD_CLEAR_QUE, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:174:8  ioctl(nbd.deviceFile.Fd(), NBD_CLEAR_SOCK, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:175:23 nbd.deviceFile.Close()
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:179:16 syscall.Write(nbd.socket, dummy)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:180:16 syscall.Close(nbd.socket)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:191:7  ioctl(nbd.deviceFile.Fd(), NBD_CONNECT, 0)
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:226:22 nbd.device.ReadAt(buf[16:16+x.len], int64(x.from))
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:229:18 syscall.Write(nbd.socket, buf[0:16+x.len])
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:236:23 nbd.device.WriteAt(buf[28:28+x.len], int64(x.from))
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:239:18 syscall.Write(nbd.socket, buf[0:16])
github.com/libopenstorage/openstorage/volume/drivers/buse/nbd.go:249:18 syscall.Write(nbd.socket, buf[0:16])
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:46:24   defer sourcefile.Close()
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:53:22   defer destfile.Close()
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:151:18  syscall.Unmount(nfsMountPath, 0)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:168:19  inst.UpdateVol(&info)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:229:15  defer f.Close()
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:265:11  os.Remove(v.DevicePath)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:268:14  os.RemoveAll(path.Join(nfsMountPath, string(volumeID)))
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:289:20  d.mounter.Unmount(path.Join(nfsMountPath, string(volumeID)), mountpath)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:337:11  d.Delete(newVolumeID)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:377:17  syscall.Unmount(nfsMountPath, 0)
github.com/libopenstorage/openstorage/volume/drivers/nfs/nfs.go:382:17  volume.Register(Name, Init)
github.com/libopenstorage/openstorage/volume/drivers/pwx/pwx.go:49:17   volume.Register(Name, Init)
github.com/libopenstorage/openstorage/volume/drivers/test/driver.go:65:14   os.RemoveAll(ctx.testPath)
github.com/libopenstorage/openstorage/volume/drivers/test/driver.go:66:11   os.Remove(ctx.testFile)
github.com/libopenstorage/openstorage/volume/drivers/vfs/vfs.go:91:14   os.RemoveAll(path.Join(volumeBase, string(volumeID)))
github.com/libopenstorage/openstorage/volume/drivers/vfs/vfs.go:112:17  syscall.Unmount(mountpath, 0)
github.com/libopenstorage/openstorage/volume/drivers/vfs/vfs.go:184:17  volume.Register(Name, Init)
make: *** [errcheck] Error 1

This is first priority

@erickhan erickhan modified the milestone: v1.3 Mar 8, 2017
@lpabon
Copy link
Contributor

lpabon commented Nov 13, 2017

Closing since it has had no update for more than 6 months. Please reopen if needed.

@lpabon lpabon closed this as completed Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants