~stephen-stewart/snapweb/client-side-filtering-and-ordering

« back to all changes in this revision

Viewing changes to snappy/icon.go

  • Committer: Snappy Tarmac
  • Author(s): Sergio Schvezov
  • Date: 2015-05-03 22:01:52 UTC
  • mfrom: (109.1.5 webdm)
  • Revision ID: snappy_tarmac-20150503220152-3t1ydw42t9yikms9
Enabling golint and fixing the issues it found to be able to enable it by sergiusens approved by chipaca

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
)
28
28
 
29
29
var (
30
 
        ErrDataPathNotSet    = errors.New("package data path not set")
 
30
        // ErrDataPathNotSet indicates that SNAP_APP_DATA_PATH has not been set by the
 
31
        // launching system.
 
32
        ErrDataPathNotSet = errors.New("package data path not set")
 
33
        // ErrOnIconDataPathSet indicates that there has been an error when setting up
 
34
        // the location where icons are going to be saved.
31
35
        ErrOnIconDataPathSet = errors.New("cannot prepare icon data path")
32
 
        ErrIconNotExist      = errors.New("the icon does not exist")
 
36
        // ErrIconNotExist happens when the package has no icon.
 
37
        ErrIconNotExist = errors.New("the icon does not exist")
33
38
)
34
39
 
35
40
func localIconPath(pkgName, iconPath string) (relativePath string, err error) {
62
67
        return filepath.Join("/", relativePath), nil
63
68
}
64
69
 
 
70
// IconDir returns information to properly serve package icons with an http.FileServer
65
71
func IconDir() (dataPath, relativeBasePath string, err error) {
66
72
        dataPath = os.Getenv("SNAP_APP_DATA_PATH")
67
73
        if dataPath == "" {