Skip to content

Commit 507ffe0

Browse files
authored
web: add generics example (#114)
1 parent d496d4b commit 507ffe0

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

web/src/services/go/snippets.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@
5757
"snippet": "Sk-SVdofEIZ"
5858
}
5959
],
60+
"Experimental features": [
61+
{
62+
"label": "Generics",
63+
"snippet": "tktmsniUZXu",
64+
"type": "experimental"
65+
}
66+
],
6067
"Concurrency": [
6168
{
6269
"label": "Goroutines",

web/src/services/go/snippets.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import snippets from './snippets.json';
22

33
export enum SnippetType {
4-
Test = 'test'
4+
Test = 'test',
5+
Experimental = 'experimental'
56
}
67

78
export interface Snippet {

web/src/utils/headerutils.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ import snippets, { Snippet, SnippetType } from '~/services/go/snippets';
44
const snippetIconTypeMapping: { [type: string]: IIconProps } = {
55
[SnippetType.Test]: {
66
iconName: 'TestPlan'
7+
},
8+
[SnippetType.Experimental]: {
9+
iconName: 'ATPLogo'
710
}
811
}
912

0 commit comments

Comments
 (0)