Giter Site home page Giter Site logo

go-fstab's People

Contributors

d-tux avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

go-fstab's Issues

Constants are all 0

You missed iota in the const list.

Also, it would be better to make them typed constants.

diff --git i/mount.go w/mount.go
index b45513f..e7b6a1a 100644
--- i/mount.go
+++ w/mount.go
@@ -28,16 +28,16 @@ type Mount struct {
        PassNo int
 }

+type DeviceIdentifierType int
+
 const (
-       Path = 0
-       Label
-       UUID
-       PartUUID
-       PartLabel
+       Path      DeviceIdentifierType = iota
+       Label     DeviceIdentifierType = iota
+       UUID      DeviceIdentifierType = iota
+       PartUUID  DeviceIdentifierType = iota
+       PartLabel DeviceIdentifierType = iota
 )

-type DeviceIdentifierType int
-
 // parseOptions parses the options field into an array of strings
 func parseOptions(optionsString string) (options map[string]string) {
        options = make(map[string]string)

Sprintf should not be public

The name is misleading and leads you to think that it behaves like fmt.Sprintf, which is not the case.
go vetactually complains about that.

In order to use it properly, you need to known what arguments are actually passed in what order to fmt.Sprintf, which you don't unless you read the source; that makes it unsafe to use.

Also, i can't think of any public use case for this.
Let's make it private.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.