From 7bf1936df3b0367511a120113145c9ab87550c2c Mon Sep 17 00:00:00 2001 From: Yicheng Qin Date: Fri, 18 Apr 2014 11:17:41 -0700 Subject: [PATCH] fix(btrfs): build btrfs based on platform --- pkg/btrfs/{btrfs.go => btrfs_linux.go} | 2 ++ pkg/btrfs/btrfs_stubs.go | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) rename pkg/btrfs/{btrfs.go => btrfs_linux.go} (98%) create mode 100644 pkg/btrfs/btrfs_stubs.go diff --git a/pkg/btrfs/btrfs.go b/pkg/btrfs/btrfs_linux.go similarity index 98% rename from pkg/btrfs/btrfs.go rename to pkg/btrfs/btrfs_linux.go index 66e062df9..f48dd6386 100644 --- a/pkg/btrfs/btrfs.go +++ b/pkg/btrfs/btrfs_linux.go @@ -1,3 +1,5 @@ +// +build linux,amd64 + package btrfs import ( diff --git a/pkg/btrfs/btrfs_stubs.go b/pkg/btrfs/btrfs_stubs.go new file mode 100644 index 000000000..179474738 --- /dev/null +++ b/pkg/btrfs/btrfs_stubs.go @@ -0,0 +1,17 @@ +// +build !linux !amd64 + +package btrfs + +import ( + "fmt" +) + +// IsBtrfs checks whether the file is in btrfs +func IsBtrfs(path string) bool { + return false +} + +// SetNOCOWFile sets NOCOW flag for file +func SetNOCOWFile(path string) error { + return fmt.Errorf("unsupported for the platform") +}