Skip to content

Commit 9710441

Browse files
committed
add
1 parent 5695d35 commit 9710441

File tree

4 files changed

+169
-12
lines changed

4 files changed

+169
-12
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
title: "Advanced Go Patterns"
3+
description: "Learn advanced design patterns and best practices in Go"
4+
labs:
5+
- { slug: "decorator-pattern-lab", description: "Implement the Decorator Pattern in Go" }
6+
- { slug: "state-pattern-lab", description: "Build a state machine using the State Pattern" }
7+
- { slug: "concurrency-patterns-lab", description: "Implement common concurrency patterns" }
8+
---
9+
10+
# Advanced Go Patterns
11+
12+
This course covers advanced design patterns and architectural approaches in Go programming. You'll learn how to structure large-scale applications, implement common design patterns, and leverage Go's concurrency features effectively.
13+
14+
## What You'll Learn
15+
16+
Throughout this course, you'll master advanced Go patterns including:
17+
18+
- Concurrency patterns and channels best practices
19+
- Error handling strategies for robust applications
20+
- Dependency injection and service locators
21+
- Context package and timeout management
22+
- Advanced testing strategies
23+
- SOLID principles in Go
24+
25+
## Why This Matters
26+
27+
Understanding these patterns will help you write cleaner, more maintainable Go code, especially as your applications grow in complexity. These patterns form the backbone of professional Go development.
28+
29+
## Hands-on Labs
30+
31+
This course includes practical labs where you'll implement these patterns in real-world scenarios. Each lab reinforces the concepts covered in the lectures and gives you hands-on experience applying these patterns.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Microservices with Go"
3+
description: "Build scalable, resilient microservices using Go"
4+
labs:
5+
- { slug: "basic-service-lab", description: "Create your first Go microservice" }
6+
- { slug: "api-gateway-lab", description: "Implement an API Gateway pattern" }
7+
- { slug: "event-driven-lab", description: "Build an event-driven microservice" }
8+
---
9+
10+
# Microservices with Go
11+
12+
This course will teach you how to build robust, scalable microservices using Go. You'll learn the principles of microservice architecture and how to implement them effectively using Go's lightweight concurrency model.
13+
14+
## What You'll Learn
15+
16+
Throughout this course, you'll learn:
17+
18+
- Microservice architecture patterns and best practices
19+
- Service discovery and registration
20+
- API gateway implementation
21+
- Event-driven architecture
22+
- Message queues and asynchronous communication
23+
- Circuit breaking and resilience patterns
24+
- Containerization and orchestration
25+
- Monitoring and observability
26+
- Testing microservices
27+
28+
## Why This Matters
29+
30+
Microservices architecture has become the standard for building large-scale, distributed systems. Go's simplicity, performance, and concurrency features make it an excellent choice for building microservices.
31+
32+
## Hands-on Labs
33+
34+
Each module includes practical labs where you'll implement what you've learned. By the end of the course, you'll have built a complete microservices ecosystem that demonstrates real-world patterns and techniques.

content/courses/testing-in-go.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "Testing in Go"
3+
description: "Master testing techniques and tools for Go applications"
4+
labs:
5+
- { slug: "unit-testing-lab", description: "Write effective unit tests in Go" }
6+
- { slug: "integration-testing-lab", description: "Build integration tests for Go services" }
7+
- { slug: "benchmark-lab", description: "Create performance benchmarks for your code" }
8+
---
9+
10+
# Testing in Go
11+
12+
This comprehensive course covers all aspects of testing Go applications. From basic unit tests to complex integration and end-to-end testing, you'll learn how to ensure your Go code is reliable, maintainable, and performant.
13+
14+
## What You'll Learn
15+
16+
Throughout this course, you'll master:
17+
18+
- Go's built-in testing framework
19+
- Table-driven testing approaches
20+
- Mocking and dependency injection
21+
- Integration testing strategies
22+
- Performance benchmarking
23+
- Test coverage analysis
24+
- Behavior-driven development
25+
- Continuous integration best practices
26+
- Test organization and maintainability
27+
28+
## Why This Matters
29+
30+
Testing is a critical skill for professional Go developers. Well-tested code leads to more reliable applications, easier maintenance, and more confident deployments. The techniques in this course will help you build robust testing practices into your development workflow.
31+
32+
## Hands-on Labs
33+
34+
This course includes practical labs where you'll apply testing techniques to real-world scenarios. You'll build comprehensive test suites for various types of Go applications and learn to automate your testing process effectively.

pages/courses/[slug].tsx

Lines changed: 70 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -322,21 +322,41 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
322322
return { notFound: true };
323323
}
324324

325-
// Load MDX content for the course
326-
const mdxFile = getContentFileBySlug('courses', course.slug);
325+
// Load MDX content for the course - with error handling
327326
let mdxSource: MDXRemoteSerializeResult | null = null;
328327
let labs: any[] = [];
329-
if (mdxFile && mdxFile.content) {
330-
mdxSource = await serializeMdx(mdxFile.content);
331-
if (mdxFile.frontmatter && Array.isArray(mdxFile.frontmatter.labs)) {
332-
labs = mdxFile.frontmatter.labs;
328+
329+
try {
330+
const mdxFile = getContentFileBySlug('courses', course.slug);
331+
if (mdxFile && mdxFile.content) {
332+
mdxSource = await serializeMdx(mdxFile.content);
333+
if (mdxFile.frontmatter && Array.isArray(mdxFile.frontmatter.labs)) {
334+
labs = mdxFile.frontmatter.labs;
335+
}
333336
}
337+
} catch (error) {
338+
console.warn(`Warning: MDX file not found for course ${course.slug}. Using fallback content.`);
339+
// Continue with empty/null mdxSource - the UI will handle this case
334340
}
335341

336-
return { props: { course, mdxSource, labs } };
342+
// Provide default fallback content when MDX is missing
343+
const fallbackContent = {
344+
title: course.title,
345+
description: course.description,
346+
// Any other fields that might be needed
347+
};
348+
349+
return {
350+
props: {
351+
course,
352+
mdxSource,
353+
labs,
354+
fallbackContent
355+
}
356+
};
337357
};
338358

339-
export default function CourseDetail({ course, mdxSource, labs }: { course: Course, mdxSource: MDXRemoteSerializeResult, labs: any[] }) {
359+
export default function CourseDetail({ course, mdxSource, labs, fallbackContent }: { course: Course, mdxSource: MDXRemoteSerializeResult, labs: any[], fallbackContent: any }) {
340360
const router = useRouter();
341361
const [sidebarOpen, setSidebarOpen] = useState(false);
342362
const [currentPage, setCurrentPage] = useState(0);
@@ -713,11 +733,49 @@ export default function CourseDetail({ course, mdxSource, labs }: { course: Cour
713733
)}
714734

715735
{/* Overview page (first page) */}
716-
{currentPage === 0 && mdxSource && (
736+
{currentPage === 0 && (
717737
<ReadableContent>
718-
<div className="prose prose-lg prose-indigo max-w-none">
719-
<MDXRemote {...mdxSource} components={MDXComponents} />
720-
</div>
738+
{mdxSource ? (
739+
<div className="prose prose-lg prose-indigo max-w-none">
740+
<MDXRemote {...mdxSource} components={MDXComponents} />
741+
</div>
742+
) : (
743+
<div className="prose prose-lg prose-indigo max-w-none">
744+
<h2>Course Overview</h2>
745+
<p>{course.description}</p>
746+
747+
<div className="bg-yellow-50 border-l-4 border-yellow-400 p-4 my-6">
748+
<p className="text-yellow-800">
749+
The full course content is being developed and will be available soon.
750+
You can explore the course topics in the sidebar.
751+
</p>
752+
</div>
753+
754+
<h3>What you'll learn</h3>
755+
<ul>
756+
{course.topics.map((topic, index) => (
757+
<li key={index}>{topic}</li>
758+
))}
759+
</ul>
760+
761+
<h3>About this course</h3>
762+
<p>
763+
This {course.level} level course is designed to help you master Go programming
764+
skills through practical examples and hands-on exercises. The course is taught by {course.instructor},
765+
and includes interactive labs to reinforce your learning.
766+
</p>
767+
768+
<h3>Prerequisites</h3>
769+
<p>
770+
To get the most out of this course, you should have:
771+
</p>
772+
<ul>
773+
<li>Basic understanding of Go programming syntax</li>
774+
<li>Familiarity with programming concepts</li>
775+
<li>A development environment with Go installed</li>
776+
</ul>
777+
</div>
778+
)}
721779
</ReadableContent>
722780
)}
723781

0 commit comments

Comments
 (0)