 use GoTooling in daily work. As you know, GoLang is, if you just do, okay, what is GoTooling? To sum up, GoTooling is a setup command line tool. Usually, we actually help you to increase your daily activities, productivities. Even though GoLang is a very new language, it has a huge collection of GoTooling. Actually, you can build your own using basic understanding of how you analyze understanding about the code structure. So I just like go to the GoLang website and I can see there's several tools provided by the Go community. It's actually in the GoLang.org.x.tools. Can you see it? Yes, can you see it? Yes. And actually, one of the tools that Steven used just now is a present. So it's very amazing that GoTooling actually supports every, it's like simple functions. One of the cool things like you, if you notice like in the slide, you actually can embed the Go code inside the GoPresent on a plate in the GoLang.org. So in terms of GoTooling, there's basically three categories. One is the static analysis. It means that you analyze your functions, your five-folder structure, you grab the names, and you have all the collections. You have all the statistics, variables, names, pointers, and you can build profiling based on that. Dynamic analysis, it means that when you run your program, especially like for example, you run a GoWeb server, and you want to see how is it, how is the GoRoutines behave. You can trace and see it like a defense process. Escapes analysis, you want to see your flow, the flow of your program. For example, you have a main function, and you can see, you have a defense on smaller functions. You want to see how memories, garbage collectors actually have to allocate the memory on the heap or in the stack. So this is very useful. So I just like go to one of the static analysis too, GoGuru. So this one is, you can, okay, GoGuru is somehow you didn't, I mean you didn't aware of that happens, but actually if you use some popular ID, for example, VS code, and you try to find the usage of some functions, for example, I open VS code and I have a function named locked. I want to see which actually functions call or invoke this function. So actually I try to do, if I want to find all the reference, but actually this one is not GoGuru. So the way you can see how GoGuru is working is by using GoVeam. So let's do an example here. You can see it's a bit slow because VS code is actually using their own way to find the callers and the callers. Okay, so for example, I go to Veeam and here is the same folder. So I try to look at the same file. Okay, so I have a new context function here and I want to know what is the callers, I mean which live codes actually invoke these functions. So okay, I try to run the inbuilt tool by Veeam Go. Okay, so actually we can see that there's a static function calling from two fives. One is in the benchmark test. Another one is in actually only you can jump to the functions to see actually where is it calling these functions. So is that like every way in the GoGuru tree? I mean, can you just grab? You can grab, but actually we show you the usage in the functions comments on everything. Usually you want to know actually exactly where the functions call it and it's a function call. It's not like if you grab, it's just grab a string. You can grab again and for fun. Yes, I mean you can use, for example, so this one does the whole tree or something? Yes, so I mean it's linked up to a different package. Okay, if you want to find out more about Veeam Go, I will give you the link later. For, so basically GoGuru help you to find, to analyze your source code and find out about like, yeah, one of my favorite tool is, you can see implementations. So for example, I have the same file here. I can type go implementation. I'm sorry. Is this part of Go 1.9? No, you can run it on Go 1.8. It actually is built like very long time ago. If you're interested in Go 1.9, I think it just released a few days ago and maybe it's a topic or another talk. All right, so I mean we can see like all the interface, which possibly this method or these functions implement. So like if we have all actually this error missing, possibly it actually can be an error in the different, for example, I have a 2.5 here in code and decode the code. So it's just like try to have me a better understanding about how these functions correlate to each other. Okay, back to presentations. Okay, so the next tool I want to introduce is Go Gerrit. So if you want to do like, I mean have you ever tried to do like some template gerritings in your daily work? For example, you have a struct and you would like to add more commands with it or you want to add muscle or unmushers functions to implement according to Jason's method. So actually Go Gerrit, we help you to do it automatically. Okay, let's have an example. Okay, I have a constant, actually it's named like different kind of food in Singapore. And I want to use stringer tools to add the string functions to this type. So I mean usually you just do like a switch case. Like if the food is equal to check it out, which means zero, then you just print out. So the code, okay, let me remove the output file. So here's a, so what do you do? It's like you run Go Gerrit. Then actually you find it as all the Go Gerrit comment out in your code and try to run the next argument, which is you can put like Protobuf Gerritor or use like Python Gerritor to convert from YAML to JSON for example. So after I run Go Gerrit, let's see the output file. Okay, so what you see actually is actually Gerrit code, which is not encouraged to edit because actually every time you modify your constant. And this function we do the optimization. For example, you look here or it's actually look a bit unfan, it's not really readable, but in terms of code efficiency, it's this way, it's the most automatic way and the best way to produce the string functions. And actually it can help you like you don't need to worry about or I need to add the switch case every time you are running. And since we're very helpful if you have a lot of struct and you want to generate like whether you have a, well, you have a lot of table and you want to implement that struct to define for storage layers. So it's what I'm, in my work actually, my team helped to create a script file and in the script file actually try to trigger the Go generate, which actually produce all the template file. Oh, one of the things like you can actually can do, for example, in VimGo, you can use using the Go Gerritor, but it's actually you, sorry, you can use Go implement to actually try to generate the code. For example, you want to use, is this code you want to add? Okay, for example, you want to add a new functions to implement IO reader. So I mean, how do you do that? IO reader actually is a package in Go lang. So you can use a Go implement. What's your question? Sorry. I was wondering if you use VimGo or VS code normally? I use VS code normally. But just for illustrating some example, actually a lot of Go tooling already built in VimGo. So it's very convenient if you want to understand about Go tooling. So for example, I want to implement IO reader. Okay, to know more about Go Vim, you can go to this report. I mean, sir, for the, oh, yes, you can run help VimGo inside Vim to understand more about this library. So the next tool is I want to talk about Go test. So Go test is like the basic unit test you want to do in your programming. For Go test, it's very interesting if you want to see like package coverage. For example, you want to make sure that all your code is the test unit coverage must be like more than 80%. And you want to see like, I mean, how do you increase your test coverage daily? Okay, for example, let's do it. For example, I have a locks package. And I want to see if I want to just run Go test on a Caesar coverage, but I don't, I can see that it's actually cover 24%. But I don't know which function I want to to increase. So here's how we want to break down, which actually we run a cover profile and put the statistics in the Khan functions. Okay, so after you generate the counter out, then now you're using Go tool to cover the Khan out. So you can see like break down which functions and which function you need to add test. And cool thing is like you can do it in Go Vim as well. So for example, I want to in, I mean the log.go, I want to see which actually functions Go coverage. Because I immediately all know that actually my new contact functions is highlighted that means like the coverage is very low. This is just one example. And actually the whole thing here you can you can put in your alias or something. So it's really run a little faster. Okay, the next tool, P proof. Have you ever heard about these two? I mean maybe like if you have background in C++ or something you want to do profiling your program. So what P proof do is it help you to profiling memory and the CPU. And in order to do that, you just do, you add the import package net HTTP P proof in your import list. And you don't need to do anything. And you can organize your memory profile, CPU profile, go to team profiles by running it as a net HTTP. So I try to, for example, you can put it in your code like in your router, you just add debug people on the as well as the functions, your browser can access the endpoints. And actually you can see what's happening. And you can see both memory profile and CPU profiles. If you want to generate the output, then you use runtime P proof that you can see the, when you start the main program, the main.go, each of it you start your CPU profile. But when we, I have a defer here, it means that when you stop profiling, then you get the output. Okay, let's do an example. Okay, I have a theme. I have a log five here. If you notice, I'm using the log library of a code kit, which is actually a microservice tool. So now I want to run the benchmark. And I want to see like, okay, I have like two, I have different functions, different algorithms. I want to know that compare the two or different kind of like methods. How is it different? And how do I optimize my algorithm? So here's a five. You can see like on the benchmark test. So the benchmark actually you, the main function is just like we run a loop. And you call, you invoke the functions and go test bench. We determine the number of operations we'll be running. And if we measure the timing. So, okay, let's look at the test five. The test five here, I have a three, I have two benchmarks. The benchmark simple and the benchmark with context. So you can imagine that you're when you pass to the log, your log interface with a simple context or it was a simple, it says no context and maybe with context. So let's try to run it. And this time you want to generate the CPU memory profile and the CPU profile. Okay. So now you see in your, your local folder, there's three new files. Log, log test, CPU memory, CPU profile and the memory profile. Yeah, this one. So what you want to see is actually you want to analyze it. For example, you want to see the allocations, the memory allocations in each functions. So we can be using it using the go to, you know, you want to chase allocation space. Okay. So here's, I want to, to, to using your P-Probe tool to see what is the allocation space in the memory. So in the, once you are in the P-Probe mode, you actually see the breakdown. You can actually try to find out for them. I want to see what is the most like memory consuming operations. To visualize this, you actually, you can open, you can export the functions as a web, sorry, SVG5, but actually you can see it as a PNG5. So now actually P-Probe will generate the image of your memory profile. And you can see it actually is more visualized. Let's open it. Okay. So actually you can see the locs, memory files. And I mean, you can see which functions, which actually most consume the memory. So as, as you can see, like if you add context or something into your functions, actually it takes some of the, some parts of your memory. For example, this context.loc already occupy 45.59%. We want to dig more to our location space. Let me sit here. You can actually try to do, try to build your program, but you use GCFlex. It means that you want to see like how the garbage collector is going. Go build GCFlex. Sorry. So what, what go build when you add the GCFlex, it means that which we try to illustrate your programs to see the, to do the escaping analysis. So that is a, it's like for you to want to dig down into your programs, especially like if you want to see whether your memory, that's why if, as you know, like if you want to, we have a heap, heap memory and a stack memory. So those things, if, if it and I look at it, then if we go to the heap, if you, you have like, for example, a predefined slice or, or mapped, actually if you know the, like the capacities, it's actually you put, rather put it in the stack. The stack is like you saving your, you know, the exact locations. Heap is like, you can dynamically allocate the memory as a runtime. Okay. Let's move on to the next two. Go manually. So, yeah, the GCFlex is, it's a basically detects memory leaks. Yes. You can actually detect. It's escape analysis. So even to detect your memory leak, you, you need to run your programs. I think I have an example here. Okay. Okay. For them, I have a fine names a little ago. I will, oh, sorry. Okay. I have a JWT package. I went to, to build the package. For them, if I go build anything, without anything, right, without any flag. Sorry. Yeah. Okay. I have a red limit package. And I, if I want to go build it just has to generate a binary file. So, but if you want to see the escaping analysis, then I will, I need to pass in the flag. Go build minus GCFlex. Okay. So, and actually I can see, like, the flow of the program from, I mean, the flow of the functions, it jump, it jump from different functions. And you can see all the leaks. And if you want to know where the, your memory is like, like, oh, yeah. So after you can see, like, oh, it's a line, like, 255. Thank you. Sorry. Okay. So it's, it's, it's how you do escape analysis. But I mean, it's very, like, it's quite a bit advanced. So maybe I need more time for leverage on this point. Okay. So, moving to the go made talent. I mean, this one is my, one's my favorite, my favorite too. Because you usually do to, to link your program to, like, check all the errors, to check all, like, do the static check. Go made talent is actually a collection of all those. It means that we run all those lintel check for you. So let me try to run this one. So for them, I have a, I have this package, this package going to, and I want to, I want to refactor it. So I mean, now, where do I start? So well, what I'm doing here is I run go metadata to, to using, to gather all the warnings from those lintel package. And I, I pass it to a comment actually try to get the most popular five problems in this package. Okay. So actually it tell me, like, there's some errors. Like, for them, this one is undeclared name. Yeah. So even if there's some, like, you can detect, help me to detect these functions. For them, I forget to add a comment to all, I mean, I have unused private variables or such things. So I mean, it's just one example. So every time I commit a code, actually I run go metadata first. So it's, I mean, how to improve my productivities. Okay. The last thing I just mentioned, actually you can build your own go-to. How to do it? This actually is, it's how you do the static analysis of your program. You inspect it using the go-passer tool. You build a node, imagine that you, you have the ID, for example, you have the VS code, and you actually, you have the different fives. And you use the link of all the functions. And each function is linked to different methods. And those actually symbolize for the nodes. It's kind of like an ASD tree. So like you imagine, you have a binary search tree. And now you have a linking of different methods and programs. So what you do is like you use all the available tools that I just, what I just mentioned for the beginning. You use like go-printer, it's like another package to processes and output it. So eventually you actually, you can build your go-out tools. And the last step, actually, you just make it to be your, to run it as a go-in storage, make it a command line, put it in the go-pass, then actually you can invoke it anywhere. So this is all my presentation. It's just going to do a summary of what possibly you can use in your day, use go-to to do it to enhance your workflow. And most of the tools here, it's already integrated in GoVeam. So it's very useful ID to use, it's really ID to enhance your product activities. But I think for a personal preference, I still use VS code because it's more user-friendly. Okay. That's all. Do you have any questions? I was wondering if there were like native go-link tools for like generating the the JSON parser and we've got a JSON, like you've given a P to JSON to generate the struct. I know there are tools, but I was wondering if there was like a go-generate for that. There should be. It's a JSON, you want to add different text, right? Is that for example, you have a list, you have a different views? Like for example, this JSON will be like, for example, they have names and so on? Yeah, like tools to help coordinate JSON and structs. I know there's something existing, but I was wondering if it would be in the base. Okay. I think those tools are available just like when you produce a code. For example, you have a struct, like something like this. You should use, I mean, that's a JSON enum. It means that you you can add a tag to a JSON using the reflex because most of the tool here underlined using a reflex library to evaluate the type. You can add the JSONs. So the output here is like, the node here is deepened views in your struct. And when it passed to the ASD tree and it adds the JSON, usually you add the JSON. It's a curly back. I mean, it's a quote. Yeah. So it's a writing to the output. Yeah. I think if you are interested, you can set form JSON enum. Oh, yeah, this one. I was using the GoJerate tool to pass in the struct and to convert it to a JSON friendly. If you want to do more functionalities in the JSON text, maybe it's a Go tag already. It's like, I don't remember, but yeah, I think it's like you can use VSCode. I don't know. I mean, how VSCode do it, but actually you can able to add the extra few to your struct. I mean, you can try it if you, yeah. Any more questions? Okay. Without any questions, I hope you can learn something today. Use small go-to or build your own go-to in your daily work. I would like to recommend if you have time, you can go through all those available tools by Golang. I mean, this is very useful when you want to do a refactor or you will do to move your code or package to different locations or maybe you want to use to build your pythons. For example, you go to here, it's just like you want to run your documentation of your own code. I mean, let you just list down all your comments and become the documentations. Yeah, so that's it. Thank you.