DEV Community

loading...

lab 2: first PR

yzwdroid profile image Andy Yang Updated on ・1 min read

To create a pull request, I need to find an issue on repos. Two new features were added to this project, and the pr address.

// add new features to support -v --version and HTTP timeout.
flag "github.com/spf13/pflag"

filenamePtr = flag.StringP("file", "f", "", "filename input (required)") // filename input
verbosePtr = flag.BoolP("version", "v", false, "verbose output")         // (error logs)


client := http.Client{
        Timeout: 5 * time.Second,
    }
resp, err := client.Head(link)

Enter fullscreen mode Exit fullscreen mode

I first add an issue to the repo, asked the author about the new feature. When I got the permit to work with the new feature, I forked the repo, and cloned it to my local machine. After adding the new feature, I merged it into the master(main) branch, then pushed it to the remote repo.

Github is pretty smart about the pull request process. When my forked version is one commit ahead of the original repo, Github gives me a choice to do a pull request.

When an issue was created, you can link the issue to a specific PR. The issue will be closed if we close the PR.

Discussion (0)

pic
Editor guide