Posts

Showing posts with the label read file

read file in golang

pwd , _ := os . Getwd () jsonFile , err := ioutil . ReadFile ( pwd + "/fakeFundDataJson.json" ) if err != nil { fmt . Println ( err ) } fmt . Println ( "Successfully Opened users.json" ) w . Write ( jsonFile ) w . WriteHeader ( http . StatusOK ) w . Header (). Add ( "Content-type" , "application/json" )