MCPcopy Create free account

hub / github.com/RezaSi/go-interview-practice / functions

Functions12,886 in github.com/RezaSi/go-interview-practice

↓ 10 callersFunctiongetRequestID
TODO: Implement middleware functions
packages/gin/challenge-2-middleware/submissions/4mzy/solution.go:80
↓ 10 callersFunctionsendErrorResponse
(c *gin.Context, status int, message string)
packages/gin/challenge-2-middleware/submissions/PolinaSvet/solution.go:176
↓ 10 callersFunctionwriteError
(w http.ResponseWriter, status int, msg string)
challenge-9/submissions/odelbos/solution-template.go:318
↓ 10 callersFunctionwriteError
(w http.ResponseWriter, statusCode int, message string)
challenge-9/submissions/PolinaSvet/solution-template.go:376
↓ 10 callersFunctionwriteJSONError
(w http.ResponseWriter, error, description string, status int)
challenge-15/submissions/odelbos/solution-template.go:241
↓ 10 callersFunctionwriteJSONError
(w http.ResponseWriter, errCode, desc string, status int)
challenge-15/submissions/imankhodadi/solution-template.go:237
↓ 10 callersFunctionwriteJsonError
(w http.ResponseWriter, statusCode int, err error)
challenge-9/submissions/ne0phyte/solution-template.go:301
↓ 10 callersFunctionwriteJsonError
(w http.ResponseWriter, statusCode int, err error)
challenge-9/submissions/brenoamin/solution-template.go:320
↓ 10 callersFunctionwriteJsonResponse
Helpers
challenge-9/submissions/nzamulov/solution-template.go:340
↓ 9 callersMethodClone
()
challenge-15/submissions/mvsouza/solution-template.go:460
↓ 9 callersFunctionConnectDB
ConnectDB establishes a connection to the SQLite database with auto-migration
packages/gorm/challenge-4-advanced-queries/solution-template.go:47
↓ 9 callersMethodCreateCompoundIndex
CreateCompoundIndex creates compound indexes for complex query patterns
packages/mongodb/challenge-4-indexing-performance/solution-template.go:177
↓ 9 callersFunctionCreateUser
CreateUser creates a new user in the database
packages/gorm/challenge-1-crud-operations/solution-template.go:26
↓ 9 callersMethodPerimeter
()
challenge-10/submissions/ahmedpyarali2/solution-template.go:13
↓ 9 callersMethodProcess
(ctx context.Context, content []byte)
challenge-11/submissions/Cpoing/solution-template.go:26
↓ 9 callersMethodSize
()
challenge-28/solution-template.go:213
↓ 9 callersMethodValidate
(data []byte)
challenge-12/submissions/Cpoing/solution-template.go:21
↓ 9 callersFunctionerrorResponse
errorResponse writes a standard failure APIResponse with the given message, validation errors, error code, and HTTP status, echoing the X-Request-ID h
packages/gin/challenge-3-validation-errors/submissions/PopovMarko/solution.go:434
↓ 9 callersFunctionokResponse
--------------------------------------------------------------- Helper functions ---------------------------------------------------------------
packages/gin/challenge-4-authentication/submissions/odelbos/solution.go:675
↓ 9 callersMethodremove
(v int)
challenge-25/submissions/Gandook/solution-template.go:68
↓ 8 callersMethodAllow
()
challenge-29/solution-template.go:133
↓ 8 callersFunctionConnectDB
ConnectDB establishes a connection to the SQLite database and auto-migrates the models
packages/gorm/challenge-2-associations/solution-template.go:39
↓ 8 callersFunctionConnectDB
ConnectDB establishes a connection to the SQLite database
packages/gorm/challenge-3-migrations/solution-template.go:42
↓ 8 callersMethodCreateUser
CreateUser creates a new user in the database
packages/mongodb/challenge-1-connection-crud/solution-template.go:55
↓ 8 callersMethodFetch
(ctx context.Context, url string)
challenge-11/submissions/Cpoing/solution-template.go:21
↓ 8 callersFunctionNewCircle
NewCircle creates a new Circle with validation
challenge-10/solution-template.go:52
↓ 8 callersFunctionNewRectangle
NewRectangle creates a new Rectangle with validation
challenge-10/solution-template.go:23
↓ 8 callersFunctionNewTriangle
NewTriangle creates a new Triangle with validation
challenge-10/solution-template.go:83
↓ 8 callersMethodSend
Send sends a message to the client
challenge-8/submissions/PolinaSvet/solution-template.go:28
↓ 8 callersMethodTransform
(data []byte)
challenge-12/submissions/Cpoing/solution-template.go:26
↓ 8 callersFunctionWriteError
(w http.ResponseWriter, statusCode int, errorStr, description string)
challenge-15/submissions/nzamulov/solution-template.go:459
↓ 8 callersFunctionfileExists
fileExists checks if a file exists
packages/cobra/challenge-2-flags-args/solution-template.go:336
↓ 8 callersFunctionrespondWithJSON
============================================ HELPER FUNCTIONS ============================================
challenge-9/submissions/Kosench/solution-template.go:523
↓ 8 callersFunctionsetupRouter
Setup router
packages/gin/challenge-3-validation-errors/solution-template.go:352
↓ 8 callersFunctionsetupTestApp
()
packages/fiber/challenge-4-authentication/solution-template_test.go:13
↓ 8 callersFunctionsetupTestApp
()
packages/fiber/challenge-1-basic-routing/solution-template_test.go:14
↓ 8 callersFunctionwriteErrorAuthorize
(w http.ResponseWriter, statusCode int, message, redirectURI string)
challenge-15/submissions/PolinaSvet/solution-template.go:356
↓ 8 callersFunctionwriteJSON
Helper functions
challenge-9/submissions/odelbos/solution-template.go:313
↓ 8 callersFunctionwriteJSON
(w http.ResponseWriter, statusCode int, data interface{})
challenge-9/submissions/imankhodadi/solution-template.go:211
↓ 8 callersFunctionwriteJSON
writeJSON writes a JSON response
challenge-9/submissions/PolinaSvet/solution-template.go:298
↓ 8 callersFunctionwriteJSONError
(w http.ResponseWriter, errCode, desc string, status int)
challenge-15/submissions/Cpoing/solution-template.go:236
↓ 8 callersFunctionwriteJSONReponse
(w http.ResponseWriter, data any, status int)
challenge-9/submissions/Cpoing/solution-template.go:210
↓ 8 callersFunctionwriteJsonResponse
(w http.ResponseWriter, statusCode int, data any)
challenge-9/submissions/ne0phyte/solution-template.go:293
↓ 8 callersFunctionwriteJsonResponse
Helper functions ...
challenge-9/submissions/brenoamin/solution-template.go:312
↓ 7 callersMethodAddValue
Add a value to context
challenge-30/solution-template.go:18
↓ 7 callersMethodAllow
()
challenge-29/solution-template.go:201
↓ 7 callersMethodCreateAccount
CreateAccount creates a new bank account with initial balance
packages/mongodb/challenge-5-transactions-advanced/solution-template.go:97
↓ 7 callersMethodCreateProduct
CreateProduct adds a new product to the database
challenge-13/solution-template.go:38
↓ 7 callersMethodCreateTextIndex
CreateTextIndex creates a text search index with proper weights
packages/mongodb/challenge-4-indexing-performance/solution-template.go:150
↓ 7 callersFunctionCreateUser
CreateUser creates a new user using GORM's generics API
packages/gorm/challenge-5-generics/solution-template.go:52
↓ 7 callersMethodFront
Front returns the front element without removing it Returns an error if the queue is empty
challenge-27/solution-template.go:108
↓ 7 callersFunctionGenerateRandomString
GenerateRandomString generates a random string of the specified length
challenge-15/submissions/Kosench/solution-template.go:166
↓ 7 callersMethodGet
(key string)
challenge-28/solution-template.go:92
↓ 7 callersMethodGetProduct
GetProduct retrieves a product by ID
challenge-13/solution-template.go:45
↓ 7 callersMethodGetProductsByPriceRange
GetProductsByPriceRange retrieves products within a price range
packages/mongodb/challenge-2-queries-filtering/solution-template.go:97
↓ 7 callersMethodGetTransactionHistory
GetTransactionHistory retrieves transaction history for an account
packages/mongodb/challenge-5-transactions-advanced/solution-template.go:125
↓ 7 callersMethodLen
heap.Interface
challenge-25/submissions/odelbos/solution-template.go:122
↓ 7 callersFunctionNewChatServer
NewChatServer creates a new chat server instance
challenge-8/solution-template.go:35
↓ 7 callersFunctionNewOAuth2Server
NewOAuth2Server creates a new OAuth2Server
challenge-15/solution-template.go:114
↓ 7 callersFunctionNewProductStore
NewProductStore creates a new ProductStore with the given database connection
challenge-13/solution-template.go:25
↓ 7 callersMethodPut
(key string, value interface{})
challenge-28/solution-template.go:98
↓ 7 callersFunctionSaveConfig
SaveConfig saves configuration to default location
packages/cobra/challenge-4-advanced-features/submissions/PolinaSvet/solution.go:571
↓ 7 callersMethodStoreDocument
StoreDocument stores large documents using GridFS
packages/mongodb/challenge-5-transactions-advanced/solution-template.go:181
↓ 7 callersFunctioncleanupTestDB
()
challenge-13/solution-template_test.go:24
↓ 7 callersFunctionexecuteCommand
Helper function to execute command and capture output
packages/cobra/challenge-1-basic-cli/solution-template_test.go:13
↓ 7 callersFunctionfloatEquals
Helper function to check if two float64 values are approximately equal
challenge-10/solution-template_test.go:17
↓ 7 callersFunctionhandleError
TODO: Implement handler functions
packages/gin/challenge-1-basic-routing/submissions/4mzy/solution.go:61
↓ 7 callersFunctionmapErrorToStatusCode
(err error)
challenge-9/submissions/Kosench/solution-template.go:546
↓ 7 callersFunctionokResponse
(c *gin.Context, status int, message string, data interface{})
packages/gin/challenge-2-middleware/submissions/odelbos/solution.go:355
↓ 7 callersFunctionokResponse
(c fiber.Ctx, status int, msg string, data interface{})
packages/fiber/challenge-2-middleware/submissions/odelbos/solution.go:349
↓ 7 callersFunctionresponseSuccess
(c *gin.Context, data interface{})
packages/gin/challenge-2-middleware/submissions/shansing/solution.go:42
↓ 7 callersFunctionsafeUser
(user User)
packages/fiber/challenge-4-authentication/submissions/odelbos/solution.go:393
↓ 7 callersFunctionsanitizeString
in a production setting, fields like Name and Description that could be rendered in a UI should be sanitized against HTML/script injection (e.g., usin
packages/gin/challenge-3-validation-errors/submissions/imankhodadi/solution.go:221
↓ 7 callersFunctionsendJSONResponse
Helper =======================================================================
packages/gin/challenge-1-basic-routing/submissions/PolinaSvet/solution.go:297
↓ 7 callersFunctionsetupTestApp
()
packages/fiber/challenge-3-validation-errors/solution-template_test.go:13
↓ 7 callersFunctionsetupTestDB
(t *testing.T)
challenge-13/solution-template_test.go:11
↓ 7 callersFunctionsetupTestData
(db *gorm.DB)
packages/gorm/challenge-4-advanced-queries/solution-template_test.go:27
↓ 7 callersFunctionsuccessResponse
(c *gin.Context, data interface{}, msg string, status int)
packages/gin/challenge-2-middleware/submissions/PopovMarko/solution.go:479
↓ 7 callersFunctionwriteJson
writeJson writes ResponseWriter with encoded json response
challenge-9/submissions/PopovMarko/solution-template.go:570
↓ 7 callersFunctionwriteJsonResponse
(w http.ResponseWriter, res any)
challenge-9/submissions/mick4711/solution-template.go:447
↓ 6 callersMethodAnalyzeQueryPerformance
AnalyzeQueryPerformance analyzes the performance of a given query
packages/mongodb/challenge-4-indexing-performance/solution-template.go:122
↓ 6 callersMethodCapacity
()
challenge-28/submissions/nzamulov/solution-template.go:14
↓ 6 callersMethodClear
()
challenge-28/submissions/nzamulov/solution-template.go:12
↓ 6 callersFunctionCreateUserWithPosts
CreateUserWithPosts creates a new user with associated posts
packages/gorm/challenge-2-associations/solution-template.go:45
↓ 6 callersMethodDropIndex
DropIndex safely removes an index by name
packages/mongodb/challenge-4-indexing-performance/solution-template.go:190
↓ 6 callersFunctionFindIndex
FindIndex returns the index of the first occurrence of the given element or -1 if not found
challenge-27/solution-template.go:216
↓ 6 callersMethodFreezeAccount
FreezeAccount freezes an account to prevent transactions
packages/mongodb/challenge-5-transactions-advanced/solution-template.go:140
↓ 6 callersFunctionGenerateRandomString
GenerateRandomString generates a random string of the specified length
challenge-15/submissions/PolinaSvet/solution-template.go:322
↓ 6 callersMethodGetMetrics
()
challenge-20/solution-template.go:57
↓ 6 callersFunctionGetMigrationVersion
GetMigrationVersion gets the current migration version
packages/gorm/challenge-3-migrations/solution-template.go:60
↓ 6 callersMethodGetProductsByCategory
GetProductsByCategory retrieves products by category with optional filtering
packages/mongodb/challenge-2-queries-filtering/solution-template.go:77
↓ 6 callersMethodGetProductsByTags
GetProductsByTags retrieves products that have any of the specified tags
packages/mongodb/challenge-2-queries-filtering/solution-template.go:197
↓ 6 callersMethodGetValue
Get a value from context
challenge-30/solution-template.go:21
↓ 6 callersMethodHitRate
()
challenge-28/submissions/nzamulov/solution-template.go:15
↓ 6 callersMethodIsEmpty
IsEmpty returns true if the stack contains no elements
challenge-27/solution-template.go:73
↓ 6 callersFunctionNewBankAccount
NewBankAccount creates a new bank account with the given parameters. It returns an error if any of the parameters are invalid.
challenge-7/solution-template.go:67
↓ 6 callersFunctionNewMockReader
(data []byte, err error)
challenge-12/solution-template_test.go:19
↓ 6 callersFunctionNewMockTransformer
(input, output []byte, err error)
challenge-12/solution-template_test.go:76
↓ 6 callersFunctionNewMockValidator
(validData [][]byte, err error)
challenge-12/solution-template_test.go:43
↓ 6 callersFunctionNewMockWriter
(expectedData []byte, err error)
challenge-12/solution-template_test.go:113
← previousnext →101–200 of 12,886, ranked by callers