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

api.Filesystem in api/types.go is inconsistently used #71

Closed
bufdev opened this issue Dec 14, 2015 · 3 comments
Closed

api.Filesystem in api/types.go is inconsistently used #71

bufdev opened this issue Dec 14, 2015 · 3 comments

Comments

@bufdev
Copy link
Contributor

bufdev commented Dec 14, 2015

It's defined and used in some places, but in others you see stuff like:

ctx.Filesystem = "btrfs"
volume/volume.go:124:// BlockDriver needs to be implemented by block volume drivers.  Filesystem volume
volume/drivers/test/driver.go:29:   Filesystem string
volume/drivers/test/driver.go:39:       Filesystem:   string(""),
volume/drivers/test/driver.go:92:           Format:  api.Filesystem(ctx.Filesystem),
volume/drivers/aws/aws_test.go:24:  ctx.Filesystem = "ext4"
volume/drivers/btrfs/btrfs.go:80:       return api.BadVolumeID, fmt.Errorf("Filesystem format (%v) must be %v",
volume/drivers/nfs/nfs_test.go:30:  ctx.Filesystem = "nfs"
volume/drivers/btrfs/btrfs_test.go:57:  ctx.Filesystem = "btrfs"
api/types.go:85:// Filesystem supported filesystems
api/types.go:86:type Filesystem string
api/types.go:89:    FsNone Filesystem = "none"
api/types.go:90:    FsExt4 Filesystem = "ext4"
api/types.go:91:    FsXfs  Filesystem = "xfs"
api/types.go:92:    FsZfs  Filesystem = "zfs"
api/types.go:93:    FsNfs  Filesystem = "nfs"
api/types.go:100:   SpecFilesystem       = "format"
api/types.go:115:   Format Filesystem
api/types.go:156:   // Format Filesystem type if any
api/types.go:157:   Format Filesystem
api/client/client_test.go:50:   ctx.Filesystem = string("btrfs")
api/server/docker.go:139:       case types.SpecFilesystem:
api/server/docker.go:140:           spec.Format = types.Filesystem(v)
cli/volumes.go:86:      Format:           api.Filesystem(context.String("fs")),
@bufdev
Copy link
Contributor Author

bufdev commented Dec 14, 2015

Of note, I like to use ints for enum values for this exact reason, it becomes to easy and straightforward to substitute in regular string values.

https://github.com/peter-edge/go-protolog/blob/1edbd58e6ad417bd11e64bae59ec37530ac07964/protolog.pb.go#L18

@bufdev
Copy link
Contributor Author

bufdev commented Jan 25, 2016

This will be fixed in the refactor

@jvinod
Copy link
Contributor

jvinod commented Feb 3, 2016

merged #111

@jvinod jvinod closed this as completed Feb 3, 2016
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

2 participants