💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
[TOC] ``` import ( "fmt" "log" "github.com/vladimirvivien/gowfs" ) var fs *gowfs.FileSystem func main() { fs, err := gowfs.NewFileSystem(gowfs.Configuration{Addr: "192.168.0.110:50070", User: "im_user"}) if err != nil{ log.Fatal(err) } //获取文件信息 checksum, err := fs.GetFileChecksum(gowfs.Path{Name: `/input/README.txt`}) if err != nil { log.Fatal(err) } fmt.Println(string(checksum.Bytes)) fmt.Println (checksum) //创建目录 createTestDir( "/user/kafka/hello2") } func createTestDir(hdfsPath string) { path := gowfs.Path{Name:hdfsPath} ok, err := fs.MkDirs(path, 0744) if err != nil || !ok { log.Fatal("Unable to create test directory ", hdfsPath, ":", err) } log.Println ("HDFS Path ", path.Name, " created.") } ```