MCPcopy Create free account

hub / github.com/corsc/Beyond-Effective-Go / functions

Functions1,301 in github.com/corsc/Beyond-Effective-Go

MethodMarshalJSON
()
Chapter04/01_software_design_principles/01_minimalist_modular/01_json_interface.go:4
MethodMarshalJSON
()
Chapter05/01_clarity/12_globals/02_enum/example.go:41
MethodName
()
Chapter06/07_patterns_tricks/09_assert_interface/example_test.go:16
MethodName
()
Chapter06/07_patterns_tricks/09_assert_interface/example_test.go:21
FunctionNamingExample
()
Chapter05/02_consistency/01_style/03_naming.go:7
FunctionNew
(server, from string)
Chapter06/07_patterns_tricks/04_private_constructors/03_function_deps/01_default_implementation/example.go:9
FunctionNew
(server, from string)
Chapter06/07_patterns_tricks/04_private_constructors/03_function_deps/02_private_constructor/example.go:11
FunctionNew
()
Chapter06/07_patterns_tricks/04_private_constructors/02_internal_init/example.go:9
FunctionNew
()
Chapter06/07_patterns_tricks/04_private_constructors/01_test_only_config/example.go:9
FunctionNew
()
Chapter06/07_patterns_tricks/04_private_constructors/04_globals/example.go:10
FunctionNew
()
Chapter06/07_patterns_tricks/05_fluent_api/02_second_iteration/example.go:11
FunctionNewClient
()
Chapter06/08_test_induced_damage/01_parameters/02_after/example.go:10
FunctionNewConfigManager
wrapper around the data to make it easier to use
Chapter01/05_sync_atomic/02_load_and_store/dynamic_config.go:21
FunctionNewConsumer
()
Chapter06/07_patterns_tricks/06_concurrent_code/03_latches/02_after/example.go:3
FunctionNewEncoder
(pool ObjectPool)
Chapter05/01_clarity/09_avoid_foreign_idioms/02_singleton_v2/example.go:12
FunctionNewMockUserLoader
NewMockUserLoader creates a new instance of MockUserLoader. It also registers a testing interface on the mock and a cleanup function to assert the moc
Chapter09/03_code_generation/01_brief_intro/mock_user_loader_test.go:48
FunctionNewOrderRepository
()
Chapter06/07_patterns_tricks/12_global_state/02_after/example.go:11
FunctionNewPool
(network, address string, max int)
Chapter02/05_patterns/07_pool/pool.go:9
FunctionNewStatsDClient
(config *Config)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/02_struct_config/example.go:3
FunctionNewStatsDClient
(host string, port, sampleRate, sendBuffer int, validateKeys bool, tags []string)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/01_single_function/example.go:3
FunctionNewStatsDClient
(host string, options ...Option)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/03_functional_options/example.go:7
FunctionNewStorage
()
Chapter05/03_predictability/04_constructors/02_construct_not_init/example.go:3
FunctionNewStorage
()
Chapter05/03_predictability/04_constructors/01_creation/example.go:3
FunctionNewUserManager
(cfg Config, storage Storage, risk RiskManager)
Chapter05/02_consistency/08_constructor_params/02_config_injection/example.go:8
FunctionNewUserManager
(minNameLen, maxNameLen int, storage Storage, risk RiskManager)
Chapter05/02_consistency/08_constructor_params/01_private_constructors/03_one_implementation/example.go:7
FunctionNewUserManager
(minNameLen, maxNameLen int, pwdEncoder PasswordEncoder, storage Storage, risk RiskManager)
Chapter05/02_consistency/08_constructor_params/01_private_constructors/02_only_for_testing/example.go:7
FunctionNewUserManager
(minNameLength, maxNameLen int, pwdEncoder PasswordEncoder, storage Storage, now func() time.Time, risk RiskMa
Chapter05/02_consistency/08_constructor_params/01_private_constructors/01_original/example.go:7
FunctionNewWorkerPool
(total int)
Chapter08/04_struct_tricks/01_empty/03_signal/example.go:3
MethodPassword
()
Chapter04/02_design_patterns/04_adapter/02_embedding/example.go:12
MethodPassword
()
Chapter04/02_design_patterns/04_adapter/02_embedding/example.go:18
MethodPlayInstrument
()
Chapter04/02_design_patterns/02_factory_method/01_before/example.go:25
MethodPlayInstrument
()
Chapter04/02_design_patterns/02_factory_method/01_before/example.go:34
MethodPlayInstrument
()
Chapter04/02_design_patterns/02_factory_method/01_before/example.go:44
MethodPlayInstrument
()
Chapter04/02_design_patterns/02_factory_method/01_before/example.go:54
MethodPlayInstrument
()
Chapter04/02_design_patterns/02_factory_method/01_before/example.go:64
FunctionPort
(port int)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/03_functional_options/example.go:31
MethodPort
()
Chapter04/02_design_patterns/04_adapter/03_go_types/version2/config.go:5
MethodPort
()
Chapter04/02_design_patterns/04_adapter/03_go_types/version1/config.go:5
MethodProcess
(order Order)
Chapter05/02_consistency/03_file_organization/example.go:5
FunctionProcessOrder
(order Order)
Chapter05/01_clarity/01_bad_example/02_better.go:7
FunctionProcessOrder
ProcessOrder coordinates all processes related to the order, including validation, charging the customer, issuing the receipt and informing the wareho
Chapter05/01_clarity/10_comments/04_user_fixed/example.go:5
FunctionProcessOrder
(o Order)
Chapter05/01_clarity/10_comments/01_bad_names/example.go:3
FunctionProcessOrder
(order Order)
Chapter05/01_clarity/10_comments/02_fixed/example.go:3
FunctionProcessOrder
ProcessOrder processes an order.
Chapter05/01_clarity/10_comments/03_user_comment/example.go:4
FunctionProcessOrder
(order Order)
Chapter01/01_concurrency_parallelism/02_parallelism_cost/02_concurrent/main.go:7
FunctionProcessOrder
(order Order)
Chapter01/01_concurrency_parallelism/02_parallelism_cost/01_sequential/main.go:3
FunctionProperCaseName
(in <-chan *User)
Chapter08/02_fun_with_functions/02_patterns/05_function_chaining/example.go:47
MethodProtoMessage
()
Chapter03/05_patterns/05_data/fixed.pb.go:37
MethodPut
(key, value string)
Chapter04/02_design_patterns/01_singleton/02_strict/example.go:34
MethodPut
(_ *myObject)
Chapter05/01_clarity/09_avoid_foreign_idioms/01_singleton_v1/example.go:28
MethodPut
(_ *myObject)
Chapter05/01_clarity/09_avoid_foreign_idioms/02_singleton_v2/example.go:39
MethodPut
(ctx context.Context, uri string, reqDTO interface{})
Chapter09/01_api_integrations/examples_apps/pagerduty-manager/internal/pd/api.go:63
FunctionReadFromChannel
(dataCh chan Item)
Chapter02/05_patterns/02_batching/01_standard.go:3
FunctionRefreshPeopleCache
(ctx context.Context, names []string)
Chapter02/01_go_routines/04_exit_conditions/02_fixed/exit_conditions.go:45
FunctionRefreshPeopleCache
(ctx context.Context, names []string)
Chapter02/01_go_routines/04_exit_conditions/01_broken/exit_conditions.go:39
FunctionSampleRate
(rate int)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/03_functional_options/example.go:41
MethodSave
(user *user.User)
Chapter04/01_software_design_principles/05_accept_interface_return_struct/04_testability_improved/internal/repo/user_dao.go:14
MethodSave
(user *User)
Chapter04/01_software_design_principles/05_accept_interface_return_struct/05_implicit_interfaces/example.go:27
MethodSave
save the supplied user to the database
Chapter04/01_software_design_principles/06_singles/02_responsibility/02_after/user_dao.go:12
MethodSave
save the supplied user to the database
Chapter04/01_software_design_principles/06_singles/03_abstraction/02_after/user_dao.go:12
MethodSave
save the supplied user to the database
Chapter04/01_software_design_principles/06_singles/03_abstraction/01_before/user_dao.go:12
MethodSave
(u *User)
Chapter06/04_mocks_stubs_recorders/03_quick_mocks/example_test.go:4
MethodSave
(u *User)
Chapter06/04_mocks_stubs_recorders/03_quick_mocks/example_test.go:15
MethodSave
(filename string)
Chapter05/01_clarity/09_avoid_foreign_idioms/03_builder/03_builder.go:20
MethodSave
(filename string)
Chapter05/01_clarity/09_avoid_foreign_idioms/03_builder/03_builder.go:28
MethodSave
(*Order)
Chapter05/03_predictability/03_encapsulation/02_leak_implementation/02_not_leaking/example.go:9
MethodSave
(user User)
Chapter05/02_consistency/08_constructor_params/02_config_injection/example.go:51
MethodSave
(user User)
Chapter05/02_consistency/08_constructor_params/01_private_constructors/03_one_implementation/example.go:45
MethodSave
(user User)
Chapter05/02_consistency/08_constructor_params/01_private_constructors/02_only_for_testing/example.go:37
MethodSave
(user User)
Chapter05/02_consistency/08_constructor_params/01_private_constructors/01_original/example.go:33
FunctionSayHelloHandler
(resp http.ResponseWriter, req *http.Request)
Chapter08/02_fun_with_functions/02_patterns/04_decoration/example.go:20
FunctionSelectExample
(dataCh chan Data, stopCh chan struct{})
Chapter01/02_concurrency_model/01_select_control_flow/sample.go:3
FunctionSend
(conn net.Conn, data interface{})
Chapter04/01_software_design_principles/03_delegation/03_naive/example.go:8
FunctionSend
(conn net.Conn, data interface{})
Chapter04/01_software_design_principles/03_delegation/04_optional_delegation/example.go:8
MethodSend
(to string, order Order)
Chapter06/07_patterns_tricks/04_private_constructors/03_function_deps/01_default_implementation/example.go:21
MethodSend
(to string, order Order)
Chapter06/07_patterns_tricks/04_private_constructors/03_function_deps/02_private_constructor/example.go:29
MethodSend
Send provides a mock function with given fields: to, body
Chapter06/07_patterns_tricks/04_private_constructors/02_internal_init/mock_receipt_sender_test.go:15
MethodSend
(to, body string)
Chapter06/07_patterns_tricks/04_private_constructors/02_internal_init/example.go:28
MethodSend
(from string, to string, subject string, message string, attachments []os.File)
Chapter05/02_consistency/06_params_and_return_values/03_grouping/01_initial/example.go:13
MethodSend
(from, to string, email Email)
Chapter05/02_consistency/06_params_and_return_values/03_grouping/03_by_type/example.go:13
MethodSend
(from string, to string, email Email)
Chapter05/02_consistency/06_params_and_return_values/03_grouping/02_combined/example.go:13
MethodSend
(from string, to string, subject string, message string, attachments []os.File)
Chapter05/02_consistency/06_params_and_return_values/02_scope/02_improved/example.go:13
FunctionSendBuffer
(size int)
Chapter08/02_fun_with_functions/02_patterns/03_functional_options/03_functional_options/example.go:47
FunctionSendEmail
(recipient Recipient, subject, message string)
Chapter04/01_software_design_principles/05_accept_interface_return_struct/02_accept_interface/example.go:3
FunctionSendEmail
(user *User, subject, message string)
Chapter04/01_software_design_principles/05_accept_interface_return_struct/01_accept_struct/example.go:3
FunctionSendEmail
(server string, auth smtp.Auth, from string, to string, subject string, message string, attachments []os.File)
Chapter05/02_consistency/06_params_and_return_values/02_scope/01_initial/example.go:8
MethodSendReceipt
SendReceipt provides a mock function with given fields: ctx, customerEmail, amount, receiptNo
Chapter06/02_table_driven_tests/mock_receipt_sender_test.go:17
MethodSendReceipt
(ctx context.Context, customerEmail string, amount int64, receiptNo string)
Chapter06/02_table_driven_tests/example.go:76
MethodSendReceipt
SendReceipt provides a mock function with given fields: ctx, customerEmail, amount, receiptNo
Chapter06/04_mocks_stubs_recorders/01_mocks/mock_receipt_sender_test.go:17
MethodSendReceipt
(ctx context.Context, customerEmail string, amount int64, receiptNo string)
Chapter06/04_mocks_stubs_recorders/01_mocks/example.go:76
MethodSendReceipt
SendReceipt provides a mock function with given fields: ctx, customerEmail, amount, receiptNo
Chapter06/05_test_ux/01_predictability/mock_receipt_sender_test.go:17
MethodSendReceipt
(ctx context.Context, customerEmail string, amount int64, receiptNo string)
Chapter06/05_test_ux/01_predictability/example.go:76
MethodSendReceipt
SendReceipt provides a mock function with given fields: ctx, customerEmail, amount, receiptNo
Chapter06/05_test_ux/03_reduce_duplication/02_mocks/mock_receipt_sender_test.go:17
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/07_interface_segregation/01_fat_interface/example.go:18
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/07_interface_segregation/02_thin_interface/example.go:15
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/06_singles/02_responsibility/02_after/create_user_handler.go:13
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/06_singles/02_responsibility/01_before/create_user_handler.go:13
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/06_singles/03_abstraction/02_after/create_user_handler.go:12
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter04/01_software_design_principles/06_singles/03_abstraction/01_before/create_user_handler.go:13
MethodServeHTTP
(resp http.ResponseWriter, req *http.Request)
Chapter08/02_fun_with_functions/02_patterns/04_decoration/example.go:16
← previousnext →901–1,000 of 1,301, ranked by callers