Skip to content

Latest commit

 

History

History
35 lines (23 loc) · 553 Bytes

Clearenv.md

File metadata and controls

35 lines (23 loc) · 553 Bytes

func Clearenv()

参数列表

返回值:

功能说明:

这个函数主要是清空当前环境变量

代码实例:

package main

import (
    "fmt"
    "os"
)

func main() {
    fmt.Printf("The path is: %+v\n", os.Environ())
    os.Clearenv()
    fmt.Printf("Now the path is: %+v\n", os.Environ())
}

代码输出:

//test in ArchLinux
//只放了一部分结果
The path is: [USER=miraclesu LG_ALL=zh_CN.UTF-8]
Now the path is: []