mirror of https://github.com/v2ray/v2ray-core
prototype of platform specific code
parent
cdea39ff95
commit
ab84639aaa
|
@ -0,0 +1,16 @@
|
||||||
|
// +build !windows
|
||||||
|
|
||||||
|
package platform
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type otherPlatformEnvironment struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
var environmentInstance = &otherPlatformEnvironment{}
|
||||||
|
|
||||||
|
func (e *otherPlatformEnvironment) ExpandEnv(s string) string {
|
||||||
|
return os.ExpandEnv(s)
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
// Package platform provides platform specific functionalities.
|
||||||
|
package platform
|
||||||
|
|
||||||
|
type environment interface {
|
||||||
|
ExpandEnv(s string) string
|
||||||
|
}
|
||||||
|
|
||||||
|
func ExpandEnv(s string) string {
|
||||||
|
return environmentInstance.ExpandEnv(s)
|
||||||
|
}
|
|
@ -0,0 +1,17 @@
|
||||||
|
// +build windows
|
||||||
|
|
||||||
|
package platform
|
||||||
|
|
||||||
|
import (
|
||||||
|
"os"
|
||||||
|
)
|
||||||
|
|
||||||
|
type windowsEnvironment struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
var environmentInstance = &windowsEnvironment{}
|
||||||
|
|
||||||
|
func (e *windowsEnvironment) ExpandEnv(s string) string {
|
||||||
|
// TODO
|
||||||
|
return s
|
||||||
|
}
|
Loading…
Reference in New Issue