Best Rod code snippet using utils.OutputFile
main.go
Source:main.go
...86 fmt.Printf("target: %s\n", target)87 fmt.Println("================ FULL REPORT ========================")88 outputFile := ""89 if userInput.ReportOutput != "" {90 outputFile = output.CreateOutputFile(userInput.ReportTarget, "report", userInput.ReportOutput)91 if outputFile[len(outputFile)-4:] == "html" {92 output.BannerHTML(userInput.ReportTarget, outputFile)93 }94 }95 fmt.Println("================ SCANNING SUBDOMAINS ================")96 var strings1 []string97 // change from ip to Hostname98 if utils.IsIP(target) {99 targetIP = target100 target = utils.IpToHostname(targetIP)101 }102 target = utils.CleanProtocol(target)103 if outputFile != "" {104 if outputFile[len(outputFile)-4:] == "html" {105 output.HeaderHTML("SUBDOMAINS ENUMERATION", outputFile)106 }107 }108 if userInput.ReportCrawlerSub {109 go crawler.SpawnCrawler(utils.CleanProtocol(target), protocolTemp,110 userInput.ReportIgnoreSub, dirs, subs, outputFile, mutex, "sub", false)111 }112 strings1 = input.CreateSubdomains(userInput.ReportWordSub, protocolTemp, utils.CleanProtocol(target))113 if userInput.ReportSubdomainDB {114 if userInput.ReportSpyse {115 _ = input.GetSpyseKey()116 }117 if userInput.ReportVirusTotal {118 _ = input.GetVirusTotalKey()119 }120 sonar := opendb.SonarSubdomains(utils.CleanProtocol(target))121 strings1 = opendb.AppendDBSubdomains(sonar, strings1)122 crtsh := opendb.CrtshSubdomains(utils.CleanProtocol(target))123 strings1 = opendb.AppendDBSubdomains(crtsh, strings1)124 threatcrowd := opendb.ThreatcrowdSubdomains(utils.CleanProtocol(target))125 strings1 = opendb.AppendDBSubdomains(threatcrowd, strings1)126 hackerTarget := opendb.HackerTargetSubdomains(utils.CleanProtocol(target))127 strings1 = opendb.AppendDBSubdomains(hackerTarget, strings1)128 bufferOverrun := opendb.BufferOverrunSubdomains(utils.CleanProtocol(target))129 strings1 = opendb.AppendDBSubdomains(bufferOverrun, strings1)130 if userInput.ReportSpyse {131 spyseSubs := opendb.SpyseSubdomains(utils.CleanProtocol(target), input.GetSpyseKey())132 strings1 = opendb.AppendDBSubdomains(spyseSubs, strings1)133 }134 if userInput.ReportVirusTotal {135 vtSubs := opendb.VirusTotalSubdomains(utils.CleanProtocol(target), input.GetVirusTotalKey())136 strings1 = opendb.AppendDBSubdomains(vtSubs, strings1)137 }138 }139 // be sure to not scan duplicate values140 strings1 = utils.RemoveDuplicateValues(utils.CleanSubdomainsOk(utils.CleanProtocol(target), strings1))141 enumeration.AsyncGet(protocolTemp, strings1, userInput.ReportIgnoreSub, outputFile, subs, mutex, false)142 if outputFile != "" {143 if outputFile[len(outputFile)-4:] == "html" {144 output.FooterHTML(outputFile)145 }146 }147 if targetIP != "" {148 target = targetIP149 }150 fmt.Println("================ SCANNING PORTS =====================")151 enumeration.AsyncPort(userInput.PortsArray, userInput.PortArrayBool, userInput.StartPort, userInput.EndPort,152 utils.CleanProtocol(target), outputFile, userInput.ReportCommon, enumeration.CommonPorts(), false, userInput.ReportTimeoutPort)153 fmt.Println("================ SCANNING DNS =======================")154 enumeration.LookupDNS(utils.CleanProtocol(target), outputFile, false)155 fmt.Println("================ SCANNING DIRECTORIES ===============")156 var strings2 = input.CreateUrls(userInput.ReportWordDir, protocolTemp, utils.CleanProtocol(target))157 if outputFile != "" {158 if outputFile[len(outputFile)-4:] == "html" {159 output.HeaderHTML("DIRECTORIES ENUMERATION", outputFile)160 }161 }162 if userInput.ReportCrawlerDir {163 go crawler.SpawnCrawler(utils.CleanProtocol(target), protocolTemp,164 userInput.ReportIgnoreDir, dirs, subs, outputFile, mutex, "dir", false)165 }166 enumeration.AsyncDir(strings2, userInput.ReportIgnoreDir, outputFile, dirs, mutex, false, userInput.ReportRedirect)167 if outputFile != "" {168 if outputFile[len(outputFile)-4:] == "html" {169 output.FooterHTML(outputFile)170 }171 }172 if userInput.ReportOutput != "" {173 if outputFile[len(outputFile)-4:] == "html" {174 output.BannerFooterHTML(outputFile)175 }176 }177}178//DNSSubcommandHandler >179func DNSSubcommandHandler(userInput input.Input) {180 if !userInput.DNSPlain {181 output.Intro()182 }183 target := utils.CleanProtocol(userInput.DNSTarget)184 // change from ip to Hostname185 if utils.IsIP(target) {186 target = utils.IpToHostname(target)187 }188 if target[len(target)-1] == byte('/') {189 target = target[:len(target)-1]190 }191 if !userInput.DNSPlain {192 fmt.Printf("target: %s\n", target)193 fmt.Println("================ SCANNING DNS =======================")194 }195 outputFile := ""196 if userInput.DNSOutput != "" {197 outputFile = output.CreateOutputFile(userInput.DNSTarget, "dns", userInput.DNSOutput)198 if outputFile[len(outputFile)-4:] == "html" {199 output.BannerHTML(userInput.DNSTarget, outputFile)200 }201 }202 enumeration.LookupDNS(target, outputFile, userInput.DNSPlain)203 if userInput.DNSOutput != "" {204 if outputFile[len(outputFile)-4:] == "html" {205 output.BannerFooterHTML(outputFile)206 }207 }208}209//SubdomainSubcommandHandler >210func SubdomainSubcommandHandler(userInput input.Input, mutex *sync.Mutex, dirs map[string]output.Asset, subs map[string]output.Asset) {211 if !userInput.SubdomainPlain {212 output.Intro()213 }214 target := userInput.SubdomainTarget215 var protocolTemp string216 // if there isn't a scheme use http.217 if !utils.ProtocolExists(target) {218 protocolTemp = "http"219 } else {220 protocolTemp = utils.RetrieveProtocol(target)221 }222 // change from ip to Hostname223 if utils.IsIP(target) {224 target = utils.IpToHostname(target)225 }226 if target[len(target)-1] == byte('/') {227 target = target[:len(target)-1]228 }229 if !userInput.SubdomainPlain {230 fmt.Printf("target: %s\n", target)231 fmt.Println("================ SCANNING SUBDOMAINS ================")232 }233 outputFile := ""234 if userInput.SubdomainOutput != "" {235 outputFile = output.CreateOutputFile(userInput.SubdomainTarget, "subdomain", userInput.SubdomainOutput)236 if outputFile[len(outputFile)-4:] == "html" {237 output.BannerHTML(userInput.SubdomainTarget, outputFile)238 }239 }240 var strings1 []string241 if !userInput.SubdomainNoCheck {242 strings1 = input.CreateSubdomains(userInput.SubdomainWord, protocolTemp, utils.CleanProtocol(target))243 }244 if userInput.SubdomainDB {245 if userInput.SubdomainSpyse {246 _ = input.GetSpyseKey()247 }248 if userInput.SubdomainVirusTotal {249 _ = input.GetVirusTotalKey()250 }251 sonar := opendb.SonarSubdomains(utils.CleanProtocol(target))252 strings1 = opendb.AppendDBSubdomains(sonar, strings1)253 crtsh := opendb.CrtshSubdomains(utils.CleanProtocol(target))254 strings1 = opendb.AppendDBSubdomains(crtsh, strings1)255 threatcrowd := opendb.ThreatcrowdSubdomains(utils.CleanProtocol(target))256 strings1 = opendb.AppendDBSubdomains(threatcrowd, strings1)257 hackerTarget := opendb.HackerTargetSubdomains(utils.CleanProtocol(target))258 strings1 = opendb.AppendDBSubdomains(hackerTarget, strings1)259 bufferOverrun := opendb.BufferOverrunSubdomains(utils.CleanProtocol(target))260 strings1 = opendb.AppendDBSubdomains(bufferOverrun, strings1)261 if userInput.SubdomainSpyse {262 spyseSubs := opendb.SpyseSubdomains(utils.CleanProtocol(target), input.GetSpyseKey())263 strings1 = opendb.AppendDBSubdomains(spyseSubs, strings1)264 }265 if userInput.SubdomainVirusTotal {266 vtSubs := opendb.VirusTotalSubdomains(utils.CleanProtocol(target), input.GetVirusTotalKey())267 strings1 = opendb.AppendDBSubdomains(vtSubs, strings1)268 }269 }270 if outputFile != "" {271 if outputFile[len(outputFile)-4:] == "html" {272 output.HeaderHTML("SUBDOMAINS ENUMERATION", outputFile)273 }274 }275 if userInput.SubdomainCrawler && !userInput.SubdomainNoCheck {276 go crawler.SpawnCrawler(utils.CleanProtocol(target), protocolTemp,277 userInput.SubdomainIgnore, dirs, subs, outputFile, mutex, "sub", userInput.SubdomainPlain)278 }279 // be sure to not scan duplicate values280 strings1 = utils.RemoveDuplicateValues(utils.CleanSubdomainsOk(utils.CleanProtocol(target), strings1))281 if !userInput.SubdomainNoCheck {282 enumeration.AsyncGet(protocolTemp, strings1, userInput.SubdomainIgnore, outputFile, subs, mutex, userInput.SubdomainPlain)283 } else {284 for _, elem := range strings1 {285 fmt.Println(elem)286 if userInput.SubdomainOutput == "txt" {287 output.AppendOutputToTxt(elem, outputFile)288 }289 if userInput.SubdomainOutput == "html" {290 output.AppendOutputToHTML(elem, "", outputFile)291 }292 }293 }294 if outputFile != "" {295 if outputFile[len(outputFile)-4:] == "html" {296 output.FooterHTML(outputFile)297 }298 }299 if userInput.SubdomainOutput != "" {300 if outputFile[len(outputFile)-4:] == "html" {301 output.BannerFooterHTML(outputFile)302 }303 }304}305//DirSubcommandHandler >306func DirSubcommandHandler(userInput input.Input, mutex *sync.Mutex, dirs map[string]output.Asset, subs map[string]output.Asset) {307 if !userInput.DirPlain {308 output.Intro()309 }310 target := userInput.DirTarget311 var protocolTemp string312 // if there isn't a scheme use http.313 if !utils.ProtocolExists(target) {314 protocolTemp = "http"315 } else {316 protocolTemp = utils.RetrieveProtocol(target)317 }318 if target[len(target)-1] == byte('/') {319 target = target[:len(target)-1]320 }321 if !userInput.DirPlain {322 fmt.Printf("target: %s\n", target)323 fmt.Println("================ SCANNING DIRECTORIES ===============")324 }325 target = utils.CleanProtocol(target)326 outputFile := ""327 if userInput.DirOutput != "" {328 outputFile = output.CreateOutputFile(userInput.DirTarget, "dir", userInput.DirOutput)329 if outputFile[len(outputFile)-4:] == "html" {330 output.BannerHTML(userInput.DirTarget, outputFile)331 }332 }333 var strings2 = input.CreateUrls(userInput.DirWord, protocolTemp, target)334 if outputFile != "" {335 if outputFile[len(outputFile)-4:] == "html" {336 output.HeaderHTML("DIRECTORIES ENUMERATION", outputFile)337 }338 }339 if userInput.DirCrawler {340 go crawler.SpawnCrawler(utils.CleanProtocol(target), protocolTemp,341 userInput.DirIgnore, dirs, subs, outputFile, mutex, "dir", userInput.DirPlain)342 }343 enumeration.AsyncDir(strings2, userInput.DirIgnore, outputFile, dirs, mutex, userInput.DirPlain, userInput.DirRedirect)344 if outputFile != "" {345 if outputFile[len(outputFile)-4:] == "html" {346 output.FooterHTML(outputFile)347 }348 }349 if userInput.DirOutput != "" {350 if outputFile[len(outputFile)-4:] == "html" {351 output.BannerFooterHTML(outputFile)352 }353 }354}355//PortSubcommandHandler >356func PortSubcommandHandler(userInput input.Input, common []int) {357 if !userInput.PortPlain {358 output.Intro()359 }360 target := userInput.PortTarget361 if utils.IsURL(target) {362 target = utils.CleanProtocol(userInput.PortTarget)363 }364 if target[len(target)-1] == byte('/') {365 target = target[:len(target)-1]366 }367 outputFile := ""368 if userInput.PortOutput != "" {369 outputFile = output.CreateOutputFile(userInput.PortTarget, "port", userInput.PortOutput)370 if outputFile[len(outputFile)-4:] == "html" {371 output.BannerHTML(userInput.PortTarget, outputFile)372 }373 }374 if !userInput.PortPlain {375 fmt.Printf("target: %s\n", target)376 fmt.Println("================ SCANNING PORTS =====================")377 }378 enumeration.AsyncPort(userInput.PortsArray, userInput.PortArrayBool, userInput.StartPort, userInput.EndPort,379 target, outputFile, userInput.PortCommon, common, userInput.PortPlain, userInput.PortTimeout)380 if userInput.PortOutput != "" {381 if outputFile[len(outputFile)-4:] == "html" {382 output.BannerFooterHTML(outputFile)383 }...
construct_static_backend_file.go
Source:construct_static_backend_file.go
1package process2import (3 "fmt"4 "github.com/mirzaakhena/zapp/app/model"5)6func createStaticBackendFile(tp *model.ThePackage) {7 // backend8 {9 {10 templateFile := fmt.Sprintf("templates/backend/app/main._go")11 outputFile := fmt.Sprintf("../../../%s/backend/app/main.go", tp.PackagePath)12 basic(tp, templateFile, outputFile, tp, 0664)13 }14 {15 templateFile := fmt.Sprintf("templates/backend/model/model_basic._go")16 outputFile := fmt.Sprintf("../../../%s/backend/model/system-model.go", tp.PackagePath)17 basic(tp, templateFile, outputFile, tp, 0664)18 }19 {20 templateFile := fmt.Sprintf("templates/backend/model/user-model._go")21 outputFile := fmt.Sprintf("../../../%s/backend/model/system-user.go", tp.PackagePath)22 basic(tp, templateFile, outputFile, tp, 0664)23 }24 {25 templateFile := fmt.Sprintf("templates/backend/repository/user-repository._go")26 outputFile := fmt.Sprintf("../../../%s/backend/repository/system-user.go", tp.PackagePath)27 basic(tp, templateFile, outputFile, tp, 0664)28 }29 {30 templateFile := fmt.Sprintf("templates/backend/service/auth/user-service._go")31 outputFile := fmt.Sprintf("../../../%s/backend/service/auth/system-user.go", tp.PackagePath)32 basic(tp, templateFile, outputFile, tp, 0664)33 }34 {35 templateFile := fmt.Sprintf("templates/backend/controller/restapi/user-controller._go")36 outputFile := fmt.Sprintf("../../../%s/backend/controller/restapi/system-user.go", tp.PackagePath)37 basic(tp, templateFile, outputFile, tp, 0664)38 }39 {40 templateFile := fmt.Sprintf("templates/backend/controller/restapi/router._go")41 outputFile := fmt.Sprintf("../../../%s/backend/controller/restapi/system-router.go", tp.PackagePath)42 basic(tp, templateFile, outputFile, tp, 0664)43 }44 {45 templateFile := fmt.Sprintf("templates/backend/shared/utils/identifier._go")46 outputFile := fmt.Sprintf("../../../%s/backend/shared/utils/identifier.go", tp.PackagePath)47 basic(tp, templateFile, outputFile, tp, 0664)48 }49 {50 templateFile := fmt.Sprintf("templates/backend/shared/utils/password._go")51 outputFile := fmt.Sprintf("../../../%s/backend/shared/utils/password.go", tp.PackagePath)52 basic(tp, templateFile, outputFile, tp, 0664)53 }54 {55 templateFile := fmt.Sprintf("templates/backend/shared/utils/json._go")56 outputFile := fmt.Sprintf("../../../%s/backend/shared/utils/json.go", tp.PackagePath)57 basic(tp, templateFile, outputFile, tp, 0664)58 }59 {60 templateFile := fmt.Sprintf("templates/backend/shared/utils/strings._go")61 outputFile := fmt.Sprintf("../../../%s/backend/shared/utils/strings.go", tp.PackagePath)62 basic(tp, templateFile, outputFile, tp, 0664)63 }64 {65 templateFile := fmt.Sprintf("templates/backend/shared/token/contract._go")66 outputFile := fmt.Sprintf("../../../%s/backend/shared/token/contract.go", tp.PackagePath)67 basic(tp, templateFile, outputFile, tp, 0664)68 }69 {70 templateFile := fmt.Sprintf("templates/backend/shared/token/implementation._go")71 outputFile := fmt.Sprintf("../../../%s/backend/shared/token/implementation.go", tp.PackagePath)72 basic(tp, templateFile, outputFile, tp, 0664)73 }74 {75 templateFile := fmt.Sprintf("templates/backend/shared/token/public._go")76 outputFile := fmt.Sprintf("../../../%s/backend/shared/token/public.go", tp.PackagePath)77 basic(tp, templateFile, outputFile, tp, 0664)78 }79 {80 templateFile := fmt.Sprintf("templates/backend/shared/config/contract._go")81 outputFile := fmt.Sprintf("../../../%s/backend/shared/config/contract.go", tp.PackagePath)82 basic(tp, templateFile, outputFile, tp, 0664)83 }84 {85 templateFile := fmt.Sprintf("templates/backend/shared/config/implementation._go")86 outputFile := fmt.Sprintf("../../../%s/backend/shared/config/implementation.go", tp.PackagePath)87 basic(tp, templateFile, outputFile, tp, 0664)88 }89 {90 templateFile := fmt.Sprintf("templates/backend/shared/config/public._go")91 outputFile := fmt.Sprintf("../../../%s/backend/shared/config/public.go", tp.PackagePath)92 basic(tp, templateFile, outputFile, tp, 0664)93 }94 {95 templateFile := fmt.Sprintf("templates/backend/shared/log/contract._go")96 outputFile := fmt.Sprintf("../../../%s/backend/shared/log/contract.go", tp.PackagePath)97 basic(tp, templateFile, outputFile, tp, 0664)98 }99 {100 templateFile := fmt.Sprintf("templates/backend/shared/log/implementation._go")101 outputFile := fmt.Sprintf("../../../%s/backend/shared/log/implementation.go", tp.PackagePath)102 basic(tp, templateFile, outputFile, tp, 0664)103 }104 {105 templateFile := fmt.Sprintf("templates/backend/shared/log/public._go")106 outputFile := fmt.Sprintf("../../../%s/backend/shared/log/public.go", tp.PackagePath)107 basic(tp, templateFile, outputFile, tp, 0664)108 }109 {110 templateFile := fmt.Sprintf("templates/backend/shared/transaction/contract._go")111 outputFile := fmt.Sprintf("../../../%s/backend/shared/transaction/contract.go", tp.PackagePath)112 basic(tp, templateFile, outputFile, tp, 0664)113 }114 {115 templateFile := fmt.Sprintf("templates/backend/shared/transaction/implementation._go")116 outputFile := fmt.Sprintf("../../../%s/backend/shared/transaction/implementation.go", tp.PackagePath)117 basic(tp, templateFile, outputFile, tp, 0664)118 }119 {120 templateFile := fmt.Sprintf("templates/backend/shared/transaction/public._go")121 outputFile := fmt.Sprintf("../../../%s/backend/shared/transaction/public.go", tp.PackagePath)122 basic(tp, templateFile, outputFile, tp, 0664)123 }124 {125 templateFile := fmt.Sprintf("templates/backend/shared/messagebroker/implementation-producer._go")126 outputFile := fmt.Sprintf("../../../%s/backend/shared/messagebroker/implementation-producer.go", tp.PackagePath)127 basic(tp, templateFile, outputFile, tp, 0664)128 }129 {130 templateFile := fmt.Sprintf("templates/backend/shared/messagebroker/implementation-consumer._go")131 outputFile := fmt.Sprintf("../../../%s/backend/shared/messagebroker/implementation-consumer.go", tp.PackagePath)132 basic(tp, templateFile, outputFile, tp, 0664)133 }134 {135 templateFile := fmt.Sprintf("templates/backend/shared/messagebroker/contract._go")136 outputFile := fmt.Sprintf("../../../%s/backend/shared/messagebroker/contract.go", tp.PackagePath)137 basic(tp, templateFile, outputFile, tp, 0664)138 }139 {140 templateFile := fmt.Sprintf("templates/backend/shared/messagebroker/public._go")141 outputFile := fmt.Sprintf("../../../%s/backend/shared/messagebroker/public.go", tp.PackagePath)142 basic(tp, templateFile, outputFile, tp, 0664)143 }144 {145 templateFile := fmt.Sprintf("templates/backend/shared/httpclient/contract._go")146 outputFile := fmt.Sprintf("../../../%s/backend/shared/httpclient/contract.go", tp.PackagePath)147 basic(tp, templateFile, outputFile, tp, 0664)148 }149 {150 templateFile := fmt.Sprintf("templates/backend/shared/httpclient/implementation._go")151 outputFile := fmt.Sprintf("../../../%s/backend/shared/httpclient/implementation.go", tp.PackagePath)152 basic(tp, templateFile, outputFile, tp, 0664)153 }154 {155 templateFile := fmt.Sprintf("templates/backend/shared/httpclient/public._go")156 outputFile := fmt.Sprintf("../../../%s/backend/shared/httpclient/public.go", tp.PackagePath)157 basic(tp, templateFile, outputFile, tp, 0664)158 }159 {160 templateFile := fmt.Sprintf("templates/backend/shared/error/error_code._go")161 outputFile := fmt.Sprintf("../../../%s/backend/shared/error/error_code.go", tp.PackagePath)162 basic(tp, templateFile, outputFile, tp, 0664)163 }164 {165 templateFile := fmt.Sprintf("templates/backend/shared/error/error._go")166 outputFile := fmt.Sprintf("../../../%s/backend/shared/error/error.go", tp.PackagePath)167 basic(tp, templateFile, outputFile, tp, 0664)168 }169 {170 templateFile := fmt.Sprintf("templates/backend/shared/error/error_test._go")171 outputFile := fmt.Sprintf("../../../%s/backend/shared/error/error_test.go", tp.PackagePath)172 basic(tp, templateFile, outputFile, tp, 0664)173 }174 {175 templateFile := fmt.Sprintf("templates/backend/shared/constant/constant._go")176 outputFile := fmt.Sprintf("../../../%s/backend/shared/constant/constant.go", tp.PackagePath)177 basic(tp, templateFile, outputFile, tp, 0664)178 }179 {180 templateFile := fmt.Sprintf("templates/backend/shared/extractor/extractor._go")181 outputFile := fmt.Sprintf("../../../%s/backend/shared/extractor/extractor.go", tp.PackagePath)182 basic(tp, templateFile, outputFile, tp, 0664)183 }184 {185 templateFile := fmt.Sprintf("templates/backend/._gitignore")186 outputFile := fmt.Sprintf("../../../%s/.gitignore", tp.PackagePath)187 basic(tp, templateFile, outputFile, tp, 0664)188 }189 {190 templateFile := fmt.Sprintf("templates/backend/config._toml")191 outputFile := fmt.Sprintf("../../../%s/backend/config.toml", tp.PackagePath)192 basic(tp, templateFile, outputFile, tp, 0664)193 }194 {195 templateFile := fmt.Sprintf("templates/backend/build._sh")196 outputFile := fmt.Sprintf("../../../%s/backend/build.sh", tp.PackagePath)197 basic(tp, templateFile, outputFile, tp, 0755)198 }199 {200 templateFile := fmt.Sprintf("templates/README._md")201 outputFile := fmt.Sprintf("../../../%s/README.md", tp.PackagePath)202 basic(tp, templateFile, outputFile, tp, 0664)203 }204 }205}...
construct_static_frontend_file.go
Source:construct_static_frontend_file.go
1package process2import (3 "fmt"4 "github.com/mirzaakhena/zapp/app/model"5)6func createStaticFrontendFile(tp *model.ThePackage) {7 // frontend8 {9 templateFile := fmt.Sprintf("templates/frontend/public/favicon._ico")10 outputFile := fmt.Sprintf("../../../%s/frontend/public/favicon.ico", tp.PackagePath)11 basic(tp, templateFile, outputFile, tp, 0664)12 }13 {14 templateFile := fmt.Sprintf("templates/frontend/public/index._html")15 outputFile := fmt.Sprintf("../../../%s/frontend/public/index.html", tp.PackagePath)16 basic(tp, templateFile, outputFile, tp, 0664)17 }18 {19 templateFile := fmt.Sprintf("templates/frontend/babel.config._js")20 outputFile := fmt.Sprintf("../../../%s/frontend/babel.config.js", tp.PackagePath)21 basic(tp, templateFile, outputFile, tp, 0664)22 }23 {24 templateFile := fmt.Sprintf("templates/frontend/vue.config._js")25 outputFile := fmt.Sprintf("../../../%s/frontend/vue.config.js", tp.PackagePath)26 basic(tp, templateFile, outputFile, tp, 0664)27 }28 {29 templateFile := fmt.Sprintf("templates/frontend/package._json")30 outputFile := fmt.Sprintf("../../../%s/frontend/package.json", tp.PackagePath)31 basic(tp, templateFile, outputFile, tp, 0664)32 }33 {34 templateFile := fmt.Sprintf("templates/frontend/src/App._vue")35 outputFile := fmt.Sprintf("../../../%s/frontend/src/App.vue", tp.PackagePath)36 basic(tp, templateFile, outputFile, tp, 0664)37 }38 {39 templateFile := fmt.Sprintf("templates/frontend/src/assets/style._css")40 outputFile := fmt.Sprintf("../../../%s/frontend/src/assets/style.css", tp.PackagePath)41 basic(tp, templateFile, outputFile, tp, 0664)42 }43 {44 templateFile := fmt.Sprintf("templates/frontend/dist/index._html")45 outputFile := fmt.Sprintf("../../../%s/frontend/dist/index.html", tp.PackagePath)46 basic(tp, templateFile, outputFile, tp, 0664)47 }48 {49 templateFile := fmt.Sprintf("templates/frontend/src/pages/forgotpassword._vue")50 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/forgotpassword.vue", tp.PackagePath)51 basic(tp, templateFile, outputFile, tp, 0664)52 }53 {54 templateFile := fmt.Sprintf("templates/frontend/src/pages/home._vue")55 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/home.vue", tp.PackagePath)56 basic(tp, templateFile, outputFile, tp, 0664)57 }58 {59 templateFile := fmt.Sprintf("templates/frontend/src/pages/login._vue")60 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/login.vue", tp.PackagePath)61 basic(tp, templateFile, outputFile, tp, 0664)62 }63 {64 templateFile := fmt.Sprintf("templates/frontend/src/pages/notfound._vue")65 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/notfound.vue", tp.PackagePath)66 basic(tp, templateFile, outputFile, tp, 0664)67 }68 {69 templateFile := fmt.Sprintf("templates/frontend/src/pages/register._vue")70 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/register.vue", tp.PackagePath)71 basic(tp, templateFile, outputFile, tp, 0664)72 }73 {74 templateFile := fmt.Sprintf("templates/frontend/src/pages/successregister._vue")75 outputFile := fmt.Sprintf("../../../%s/frontend/src/pages/successregister.vue", tp.PackagePath)76 basic(tp, templateFile, outputFile, tp, 0664)77 }78 {79 templateFile := fmt.Sprintf("templates/frontend/src/main._js")80 outputFile := fmt.Sprintf("../../../%s/frontend/src/main.js", tp.PackagePath)81 basic(tp, templateFile, outputFile, tp, 0664)82 }83 {84 templateFile := fmt.Sprintf("templates/frontend/src/store/index._js")85 outputFile := fmt.Sprintf("../../../%s/frontend/src/store/index.js", tp.PackagePath)86 basic(tp, templateFile, outputFile, tp, 0664)87 }88 {89 templateFile := fmt.Sprintf("templates/frontend/src/store/crudtable._js")90 outputFile := fmt.Sprintf("../../../%s/frontend/src/store/crudtable.js", tp.PackagePath)91 basic(tp, templateFile, outputFile, tp, 0664)92 }93 {94 templateFile := fmt.Sprintf("templates/frontend/src/router/index._js")95 outputFile := fmt.Sprintf("../../../%s/frontend/src/router/index.js", tp.PackagePath)96 basic(tp, templateFile, outputFile, tp, 0664)97 }98 {99 templateFile := fmt.Sprintf("templates/frontend/src/utils/httprequest._js")100 outputFile := fmt.Sprintf("../../../%s/frontend/src/utils/httprequest.js", tp.PackagePath)101 basic(tp, templateFile, outputFile, tp, 0664)102 }103 {104 templateFile := fmt.Sprintf("templates/frontend/src/utils/auth._js")105 outputFile := fmt.Sprintf("../../../%s/frontend/src/utils/auth.js", tp.PackagePath)106 basic(tp, templateFile, outputFile, tp, 0664)107 }108 {109 templateFile := fmt.Sprintf("templates/frontend/src/utils/filter._js")110 outputFile := fmt.Sprintf("../../../%s/frontend/src/utils/filter.js", tp.PackagePath)111 basic(tp, templateFile, outputFile, tp, 0664)112 }113}...
OutputFile
Using AI Code Generation
1import (2func main() {3 utils.OutputFile("2.go")4}5import (6func OutputFile(filename string) {7 f, err := os.Open(filename)8 if err != nil {9 fmt.Println(err)10 }11 defer f.Close()12 buf := make([]byte, 1024)13 for {14 n, _ := f.Read(buf)15 if 0 == n {16 }17 os.Stdout.Write(buf[:n])18 }19}20import (21func main() {22 file, err := os.Open("test.txt")23 if err != nil {24 fmt.Println(err)25 }26 defer file.Close()27 scanner := bufio.NewScanner(file)28 for scanner.Scan() {29 fmt.Println(scanner.Text())30 }31 if err := scanner.Err(); err != nil {32 fmt.Println(err)33 }34}35import (36func main() {37 file, err := os.Open("test.txt")38 if err != nil {39 fmt.Println(err)40 }41 defer file.Close()42 scanner := bufio.NewScanner(file)43 for scanner.Scan() {44 fmt.Println(scanner.Text())45 }46 if err := scanner.Err(); err != nil {47 fmt.Println(err)48 }49}
OutputFile
Using AI Code Generation
1import (2func main() {3 fmt.Println("Hello World")4 utils.OutputFile("Hello World")5}6import (7func OutputFile(s string) {8 file, err := os.Create("output.txt")9 if err != nil {10 fmt.Println(err)11 }12 defer file.Close()13 file.WriteString(s)14}
OutputFile
Using AI Code Generation
1import (2func main() {3 file, err := os.Create("test.txt")4 if err != nil {5 fmt.Println(err)6 }7 defer file.Close()8 file.WriteString("Hello World\n")9 file.WriteString("This is our new text file\n")10 file.WriteString("and this is another line.\n")11 file.WriteString("Why? Because we can.\n")12 file.Close()13 stream, err := ioutil.ReadFile("test.txt")14 if err != nil {15 fmt.Println(err)16 }17 readString := string(stream)18 fmt.Println(readString)19 err = os.Remove("test.txt")20 if err != nil {21 fmt.Println(err)22 }23 file, err = os.Create("test.txt")24 if err != nil {25 fmt.Println(err)26 }27 defer file.Close()28 file.WriteString("Hello World\n")29 file.WriteString("This is our new text file\n")30 file.WriteString("and this is another line.\n")31 file.WriteString("Why? Because we can.\n")32 file.Close()33 stream, err = ioutil.ReadFile("test.txt")34 if err != nil {35 fmt.Println(err)36 }37 readString = string(stream)38 fmt.Println(readString)39 err = os.Remove("test.txt")40 if err != nil {41 fmt.Println(err)42 }43 file, err = os.Create("test.txt")44 if err != nil {45 fmt.Println(err)46 }47 defer file.Close()48 file.WriteString("Hello World\n")49 file.WriteString("This is our new text file\n")50 file.WriteString("and this is another line.\n")51 file.WriteString("Why? Because we can.\n")52 file.Close()53 stream, err = ioutil.ReadFile("test.txt")54 if err != nil {55 fmt.Println(err)56 }57 readString = string(stream)58 fmt.Println(readString)59 err = os.Remove("test.txt")60 if err != nil {61 fmt.Println(err)62 }
OutputFile
Using AI Code Generation
1utils.OutputFile("path to the file", "data to be written to the file");2utils.InputFile("path to the file");3utils.OutputFile("path to the file", "data to be written to the file");4utils.InputFile("path to the file");5utils.OutputFile("path to the file", "data to be written to the file");6utils.InputFile("path to the file");7utils.OutputFile("path to the file", "data to be written to the file");8utils.InputFile("path to the file");9utils.OutputFile("path to the file", "data to be written to the file");10utils.InputFile("path to the file");11utils.OutputFile("path to the file", "data to be written to the file");12utils.InputFile("path to the file");13utils.OutputFile("path to the file", "data to be written to the file");14utils.InputFile("path to the file");15utils.OutputFile("path to the file", "data to be written to the file");16utils.InputFile("path to the file");17utils.OutputFile("path to the file", "data to be written to the file");18utils.InputFile("path to the file");
OutputFile
Using AI Code Generation
1import (2func main() {3 message := &test.Person{4 }5 messageBytes, _ := proto.Marshal(message)6 utils.OutputFile(messageBytes, "testfile.pb")7}8import (9func main() {10 messageBytes := utils.InputFile("testfile.pb")11 message := &test.Person{}12 proto.Unmarshal(messageBytes, message)13 fmt.Println(message)14}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!