From f5e46d134997f4f7cd873f35581cba952f31ccce Mon Sep 17 00:00:00 2001 From: AleksandrHovhannisyan Date: Wed, 26 Jun 2019 14:24:27 -0400 Subject: [PATCH] Replace 'Option struct' with 'QueueOptions struct' --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ab124fe..8eb79e1 100644 --- a/README.md +++ b/README.md @@ -385,7 +385,7 @@ q, err := ch.QueueDeclare(QueueOptions{ }) ``` -This solves two problems: misusing comments, and accidentally labeling the variables incorrectly. Of course, we can still confuse properties with the wrong value, but in these cases, it will be much easier to determine where our mistake lies within the code. The ordering of the properties also doesn't matter anymore, so incorrectly ordering the input values is no longer a concern. The last added bonus of this technique is that we can use our Option `struct` to infer the default values of our function's input parameters. When structures in Go are declared, all properties are initialised to their default value. This means that our `QueueDeclare` option can actually be invoked in the following way: +This solves two problems: misusing comments, and accidentally labeling the variables incorrectly. Of course, we can still confuse properties with the wrong value, but in these cases, it will be much easier to determine where our mistake lies within the code. The ordering of the properties also doesn't matter anymore, so incorrectly ordering the input values is no longer a concern. The last added bonus of this technique is that we can use our `QueueOptions` struct to infer the default values of our function's input parameters. When structures in Go are declared, all properties are initialised to their default value. This means that our `QueueDeclare` option can actually be invoked in the following way: ```go q, err := ch.QueueDeclare(QueueOptions{